macOS with homebrew
parent
e8bcbde824
commit
a999531ac4
|
@ -9,6 +9,13 @@ In macOS, Bash read `~/.bash_profile` not `~/.bashrc`, so edit `~/.bash_profile`
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Add to `~/.bashrc`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export HISTCONTROL=ignoreboth:erasedups
|
||||||
|
export HISTIGNORE="cd:cd *:ls:ls *:pwd:exit"
|
||||||
|
```
|
||||||
|
|
||||||
## Bash completion
|
## Bash completion
|
||||||
|
|
||||||
| Distribution | Package |
|
| Distribution | Package |
|
||||||
|
@ -20,9 +27,6 @@ In macOS, Bash read `~/.bash_profile` not `~/.bashrc`, so edit `~/.bash_profile`
|
||||||
Add to `~/.bashrc`:
|
Add to `~/.bashrc`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export HISTCONTROL=ignoreboth:erasedups
|
|
||||||
export HISTIGNORE="cd:cd *:ls:ls *:pwd:exit"
|
|
||||||
|
|
||||||
# Archlinux, Ubuntu
|
# Archlinux, Ubuntu
|
||||||
[[ -f /usr/share/bash-completion/bash_completion ]] && \
|
[[ -f /usr/share/bash-completion/bash_completion ]] && \
|
||||||
source /usr/share/bash-completion/bash_completion
|
source /usr/share/bash-completion/bash_completion
|
||||||
|
|
|
@ -4,20 +4,29 @@
|
||||||
| ------------ | ------- |
|
| ------------ | ------- |
|
||||||
| Archlinux | `fzf` |
|
| Archlinux | `fzf` |
|
||||||
| Ubuntu | `fzf` |
|
| Ubuntu | `fzf` |
|
||||||
|
| Homebrew | `fzf` |
|
||||||
|
|
||||||
Add to `~/.bashrc`:
|
Add to `~/.bashrc`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
[[ -f /usr/share/fzf/key-bindings.bash ]] && \
|
# Archlinux, Ubuntu
|
||||||
source /usr/share/fzf/key-bindings.bash
|
|
||||||
[[ -f /usr/share/fzf/completion.bash ]] && \
|
[[ -f /usr/share/fzf/completion.bash ]] && \
|
||||||
source /usr/share/fzf/completion.bash
|
source /usr/share/fzf/completion.bash
|
||||||
|
[[ -f /usr/share/fzf/key-bindings.bash ]] && \
|
||||||
|
source /usr/share/fzf/key-bindings.bash
|
||||||
|
|
||||||
|
# Homebrew
|
||||||
|
[[ -f /usr/local/opt/fzf/shell/completion.bash ]] && \
|
||||||
|
source /usr/local/opt/fzf/shell/completion.bash
|
||||||
|
[[ -f /usr/local/opt/fzf/shell/key-bindings.bash ]] && \
|
||||||
|
source /usr/local/opt/fzf/shell/key-bindings.bash
|
||||||
|
|
||||||
|
# Use fd instead of find
|
||||||
export FZF_DEFAULT_COMMAND='fd -H'
|
export FZF_DEFAULT_COMMAND='fd -H'
|
||||||
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
|
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
|
||||||
```
|
```
|
||||||
|
|
||||||
| Shorcut | Explain |
|
| Shorcut | Explain |
|
||||||
| -------- | ------------------------------------ |
|
| -------- | ------------------------------------ |
|
||||||
| `Ctrl-T` | search through files and directories |
|
| `CTRL-T` | search through files and directories |
|
||||||
| `Ctrl-R` | search though command-line history |
|
| `CTRL-R` | search though command-line history |
|
||||||
|
|
Loading…
Reference in New Issue