I set the following on my ~/.vimrc which sets the current directory to the location of the file on the buffer.

au BufEnter * silent! :lcd%:p:h

However, when I run the fzf command to search for a file, then the search starts on the current directory, althogh the file I like to get is often in other directories. So I want to set it to ~/ whenever I run fzf.

But I'm not sure if it is possible. Is it possible to set it in fzf?

2 Answers 2


The following info can be found in the official docs of fzf:

You can execute :FZF with an argument for the starting dir. So you can just run :FZF ~ instead of :FZF. If you open the fzf buffer from a mapping just change that mapping:

map <c-space> :FZF ~<cr>

(Unrelated to the question but related to the autocomand you mentioned: 'autochdir')


You can provide a default path to fzf if you configure it to use fd (or rigrep or ag) in your .bashrc.

Then calling fzf from vim will also use this path as a starting point.

My .bashrc has the following line so all searches being from my home directory:


(note that on Debian Buster, the command would be "fdfind . $HOME)

I found that this produced too many results, so I implemented a solution to have a subset of the directories in $HOME searched (see a blog post about it here)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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