-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skim != FZF with fzf#vim#grep custom command for path specific fuzzy search #18
Comments
@lotabout I have similar issue. And I have lots of customization for This is surprisingly easy to replicate though. This sample code in the README doesn't work, at least on my end: 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) So, when you type And ultimately, I just want to add something to base function! RipgrepFzf(query, fullscreen)
let command_fmt = 'rg --type py ...'
...
endfunction Also, it seems not possible to pass additional args to this core command! -bang -nargs=* Rg call fzf#vim#rg_interactive(<q-args>, fzf#vim#with_preview('right:50%:hidden', 'alt-h')) Are we missing something? BTW, thanks for this interesting/promising plugin. :) |
From the source code, function! fzf#vim#rg_interactive(dir, ...)
let dir = empty(a:dir) ? '.' : a:dir
let command = 'rg --column --line-number --color=always '.get(g:, 'rg_opts', '').' "{}" ' . dir
return call('fzf#vim#grep_interactive', extend([command, 1], a:000))
endfunction So, couldn't pass additional |
So, a workaround to pass additional " Grep the Python files only, exclude the unit tests folder/files.
function! RgPy(dir, ...)
let dir = empty(a:dir) ? '.' : a:dir
let command = 'rg --type py --glob "!**/tests/**" --column --line-number --color=always '.get(g:, 'rg_opts', '').' "{}" ' . dir
return call('fzf#vim#grep_interactive', extend([command, 1], a:000))
endfunction
command! -nargs=* -bang RgPy call RgPy(<q-args>, fzf#vim#with_preview('right:60%'))
|
man fzf
)The following command does a
rg
find in my $NOTES dir and works as expected usingfzf
. The exact same command usingskim
doesn't seem to respect therg
commands.The text was updated successfully, but these errors were encountered: