Interactive search through files with rg and searching
files with fd with fzf.vim.
fzf.vim.rgfd depends on fzf.vim which depends on the basic Vim plugin of the main fzf repository, which means you need to set up "fzf", "fzf.vim", and "fzf.vim.rgfd on Vim. To learn more about fzf/Vim integration, see README-VIM.
Using vim-plug
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'bombela/fzf.vim.rgfd'fzf#install() makes sure that you have the latest binary, but it's optional,
so you can omit it if you use a plugin manager that doesn't support hooks.
| command | description |
|---|---|
:Fd[!] [PATTERN] [PATH] [RESUME=0] |
rg search result |
:Rg[!] PATTERN [PATH] [RESUME=0] |
fd search result |
" Current working directory file search (project search).
" The search resumes with the last searched path. ctrl-r resets to the CWD.
map <C-p> :Fd . . 1<CR>
" Relative to current file search (relative search).
" The search never resumes.
map <C-\> :Fd . %:h 0<CR>
" Current working directory, grep word under cursor (project search).
" The search resumes with the last searched path. ctrl-r resets to the CWD.
map <A-p> :execute "Rg ".expand("<cword>")<CR>
" Relative to current file, grep word under cursor (relative search).
" The search never resumes.
map <A-\> :execute "Rg ".expand("<cword>")." %:h"<CR>:help fzf-vim-rgfd or doc/fzf-vim-rgfd.txt.
MIT