To find files which contains some string, the :grep
command is "for that". And I know it's quite slow.
For that purpose, I have added the :Find
command to my .vimrc
: (From this post)
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>), 1, <bang>0)
Note that with --fixed-strings
we don't have to quote the string so we theoretically should just do :Find a string with space
By the way I am also using set grepprg=rg\ --vimgrep
so instead of the original slow :grep
or :Ag
, I can use :grep finder
to find files that contains the word "finder", powered by rg
.
And use :Ag
(or :FZF
) to find files that has "finder" in their names.
Hope this helps.
--[no]filename
?