I would like to find the git root directory and use it as argument for :FZF
in a key mapping like this:
nnoremap <Leader>eg :FZF `git rev-parse --show-toplevel`<CR>
Unfortunately, this does not work. If I understand it right, backtick expansion works only when vim expects a filename. I think :FZF
expects a folder name but maybe vim doesn't know this.
How can this be done?
:help system()
and consider experimenting with github.com/junegunn/fzf.vim#advanced-customization.nnoremap <Leader>eg :echo system(['git', 'rev-parse', '--show-toplevel'])<CR>
works as expected.