fzf(Fuzzy File Finder) enhances the efficiency and convenience of your command-line workflow.
Installation of fzf
1 | # Install the fzf itself by Homebrew |
- The
.fzf.zsh
file default contents are these below: key-bindings.zsh
only containsCTRL-R
,CTRL-T
, andALT-C
1
2
3
4
5
6
7
8
9
10
11
12
13# Setup fzf
# ---------
if [[ ! "$PATH" == */opt/homebrew/opt/fzf/bin* ]]; then
PATH="${PATH:+${PATH}:}/opt/homebrew/opt/fzf/bin"
fi
# Auto-completion
# ---------------
[[ $- == *i* ]] && source "/opt/homebrew/opt/fzf/shell/completion.zsh" 2> /dev/null
# Key bindings
# ------------
source "/opt/homebrew/opt/fzf/shell/key-bindings.zsh"
Link with NeoVIM
Installation(init.vim)
- If there is no fzf binary files have been installed before, We should install fzf separately in NeoVim(By Vim-Plug or something else).
Otherwise, we could only specify the fzf pathname in our local drive which is enough.1
2
3
4
5
6
7" If there is no fzf binary files before
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
" If fzf has been installed at the local drive
Plug '/opt/homebrew/opt/fzf'
Plug 'junegunn/fzf.vim'
Configuration(init.vim)
1 | let $FZF_DEFAULT_OPTS="--height 40% --border --preview 'bat --style=numbers --color=always --line-range :500 {}'" |
There are defined 3 keybindings(CTRL-f
, CTRL-h
, CTRL-c
), and Ag
was used software installed in our local drive called The silver searcher (GitHub - ggreer/the_silver_searcher: A code-searching tool similar to ack, but faster.)
fzf(Fuzzy File Finder) enhances the efficiency and convenience of your command-line workflow.