3

I just installed fzf for my bash terminal and the fzf.vim plugin for vim. I've placed the following code at the bottom of my .bashrc script:

export FZF_DEFAULT_COMMAND='rg --files --hidden --no-ignore-vcs'
export FZF_DEFAULT_OPTS='-m --height 50% --border'

When I am in vim, I can use :FZF to search for hidden files. However, if I use the fzf.vim's :Rg command, it will not search for strings within any hidden files since it uses the regular ripgrep command, which by default, ignores hidden files.

I can search for strings within hidden files while in the terminal:

rg --hidden 'search_string'

How can I do the same thing while I'm in vim?

1

A bit late but I had this issue as well. As you're using fzf.vim you can configure the Rg command as per their instructions by adding the following to your init.vim file and adding in the --hidden option.

command! -bang -nargs=* Rg
  \ call fzf#vim#grep(
  \   'rg --hidden --column --line-number --no-heading --color=always --smart-case -- '.shellescape(<q-args>), 1,
  \   fzf#vim#with_preview(), <bang>0)

Taken from https://github.com/junegunn/fzf.vim#example-rg-command-with-preview-window

You might need to tweak this a bit if you want it displayed differently.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.