# zoxide
https://github.com/ajeetdsouza/zoxide
Quickly jump between directories you visit frequently with `z [dir_prefix]`, including an interactive fuzzy search mode `zi`. Bonus: [path insertion widget](#zoxide-path-insertion) for zsh.
# fzf
https://github.com/junegunn/fzf
Quickly find files with fuzzy search, basically tab completion on steroids.
Works much better with `fd`, benefits somewhat from `bat` (see [suggested configuration](#fzf-config)).
### Extensions
https://github.com/Aloxaf/fzf-tab replaces default tab completion with fzf (zsh only)
# ripgrep
https://github.com/BurntSushi/ripgrep
Search files by text, like grep, but faster and better. For example, search for a function you defined in one of your projects:
```sh
rg -g "*.jl*" "function softmax" ~/projects
```
# lazygit
https://github.com/jesseduffield/lazygit
Lightweight and powerful GUI for git
# fd
https://github.com/sharkdp/fd
Find files by name very quickly, makes fzf work much better.
# bat
https://github.com/sharkdp/bat
Provides syntax highlighting for (pre)viewing files in the terminal, replaces `cat`.
# fastmod
https://github.com/facebookincubator/fastmod
Find and replace with regex in a directory.
# zsh-autosuggestions
https://github.com/zsh-users/zsh-autosuggestions
Inline autocomplete based on previously entered commands.
# pure (prompt)
https://github.com/sindresorhus/pure
A relatively minimal prompt that tells you what's up with your git repo.
# Extras
## zoxide path insertion
Add this to your .zshrc file to insert paths into the command you're currently writing with the interactive zoxide panel (ctrl-p), analagous to the ctrl-t of `fzf`.
```sh
insert-setup () {
echoti rmkx
zle autosuggest-clear
zle autosuggest-disable
}
insert-do () {
BUFFER+=$1
(( CURSOR+=$#1 ))
zle autosuggest-enable
.zle_redraw-prompt
}
.zle_redraw-prompt () {
# Credit: romkatv/z4h
emulate -L zsh
for 1 ( chpwd $chpwd_functions precmd $precmd_functions ) {
if (( $+functions[$1] )) $1 &>/dev/null
}
zle .reset-prompt
zle -R
}
.zle_insert-path-zoxide () {
insert-setup
local result="$(zoxide query -i)"
if [[ $result != "''" ]]; then
insert-do "'$result'"
fi
}
zle -N .zle_insert-path-zoxide
bindkey '^p' .zle_insert-path-zoxide
```
## fzf config
Put this in your ~/.zshrc or ~/.bashrc file.
```sh
# REQUIRES fd
export FZF_DEFAULT_COMMAND='fd --no-ignore-vcs --color always'
export FZF_CTRL_T_COMMAND=$FZF_DEFAULT_COMMAND
export FZF_ALT_C_COMMAND='fd --no-ignore-vcs --color always --type d'
# REQUIRES bat
# can replace {bat -n --color=always {}} with just {head -n 200 {}} otherwise
export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS"
--ansi
--bind 'ctrl-v:change-preview-window(down|hidden|)'
--bind 'ctrl-a:toggle-all,ctrl-d:deselect-all'
--preview 'test -d {} && {tree -C {} | head -200} || {bat -n --color=always {}}'
--color=gutter:-1,bg+:-1
--color=hl+:#88f397,hl:#76D384
--color=fg+:#eaeaea,fg:#CACACC
--color=info:#7485ba,prompt:#f297cd,pointer:#f297cd
--color=marker:#f297cd,spinner:#c4a9f4,header:#88f397
"
export FZF_ALT_C_OPTS="--ansi --preview 'tree -C {} | head -200'"
export FZF_CTRL_T_OPTS="--select-1 --exit-0"
```