junegunn / fzf.vim

fzf :heart: vim
MIT License
9.55k stars 583 forks source link

Bang flag ignored when passed to fzf #1405

Closed cmdusr closed 1 week ago

cmdusr commented 2 years ago

I want to filter out 'Intermediate' when searching for files. This works when starting fzf normally outside of vim: fzf -q !Intermediate

I have defined a custom command in my vimrc:

command! -bang -nargs=? -complete=dir CPPFiles call fzf#vim#files(<q-args>, fzf#vim#with_preview({'options': ['-q', '.cpp$ !Intermediate']}), <bang>0)

But by using this command fzf starts with 'intermediate' (without the '!' character) giving me the exact opposite of what I want.

Is an escape sequence required or is this a bug?

I'm running gvim on windows but I can also reproduce running terminal vim from cmd.

Thanks.

cmdusr commented 1 year ago

The gist of it is I want '!intemediate' instead of 'intemediate' in the query. I have searched through other issues and the closest I can find is this one: https://github.com/junegunn/fzf.vim/issues/782 But I have defined a new command and it has no problem with '|' characters but '!' characters always expand to nothing. Using the cmd escape sequence /! also dosen't work.

cmdusr commented 1 year ago

My issue is a year old without a resolution in sight, is this project dead?

command! CPPFiles call fzf#run({'options': ["--query", "!intermediate"]}) nnoremap cpp CPPFiles

Dosen't work nor does escaping the '\!' or having it as it's own member of the list options

:FZF -q \!intermediate

Also dosen't work

:!fzf -q \!intermediate Works but defeats the point of the plugin

cmdusr commented 1 week ago

I'm delighted to say that this is now working!