[x] I have read through the manual page of fzf (man fzf)
[x] I have searched through the existing issues
Too stupid for customized RG Command in vim - help needed please.
Hey guys, i am having trouble adapting an advanced vim command explained in your Readme file already and i cannot get it to run as i'd like to.
The following snippet is from my vimrc and it should introduce 2 shortcuts if rg is available as a bash command:
Cmd-F should open an interactive search window where i can enter a search term followed by an optional path e.g. C-F foo app/ should open the interactive search window, i enter the phrase foo as a search keyword and want to limit the search results on the app directory
K should act the same as Cmd-F with the difference that it has already a search term prefilled (the full word under the cursor)
Everything works as expected except the limitation to the given directory. What am i doing wrong here?
if executable("rg")
function! RipgrepFzf(query, fullscreen)
let command_fmt = 'rg --column --line-number --no-heading --color=always --smart-case -- %s || true'
let initial_command = printf(command_fmt, shellescape(a:query))
let reload_command = printf(command_fmt, '{q}')
let spec = {'options': ['--phony', '--query', a:query, '--bind', 'change:reload:'.reload_command]}
call fzf#vim#grep(initial_command, 1, fzf#vim#with_preview(spec), a:fullscreen)
endfunction
command! -nargs=* -bang RG call RipgrepFzf(<q-args>, <bang>0)
noremap <C-F> :RG<space><CR>
nnoremap K :RG <C-R><C-W><CR>
endif
Any help or suggestions are appreciated (even if it's only coding style due to me being new in vim and configuring it)
man fzf
)Too stupid for customized RG Command in vim - help needed please.
Hey guys, i am having trouble adapting an advanced vim command explained in your Readme file already and i cannot get it to run as i'd like to.
The following snippet is from my vimrc and it should introduce 2 shortcuts if
rg
is available as a bash command:C-F foo app/
should open the interactive search window, i enter the phrase foo as a search keyword and want to limit the search results on the app directoryK
should act the same as Cmd-F with the difference that it has already a search term prefilled (the full word under the cursor)Everything works as expected except the limitation to the given directory. What am i doing wrong here?
Any help or suggestions are appreciated (even if it's only coding style due to me being new in vim and configuring it)