This is not specific to :Files, but any rg command that returns an exit code of 1. Looks like the only difference here is that if rg is run and returns no results, the exit code is 1, which is expected, and fzf bombs out with a Command failed error. Is there a way to cancel fzf by pressing escape. The :Ag command lets you search the contents of files, opposed to its :Files command, which only searches file names. If I move to a directory with files and other directories and run :Files, it works as expected. FZF+Vim, an extra plugin in addition to fzf, provides an :Ag command to use in (g)vim. If I set the FZF_DEFAULT_COMMAND='rg -files -no-ignore-vcs -hidden' for fzf to use rg by default, I now get a "" error and fzf doesn't show anything other than a prompt of the current directory. Now, in neovim, using stock fzf.vim install with no FZF_DEFAULT_COMMAND environment variable set, it works fine when :Files is invoked in an empty directly. If I run "rg -filez" to intentionally invoke a command failure, I get $LastExitCode of 2, as expected. This is not an error, but expected behaviour If I run "rg -files" in an empty directory, the $LastExitCode returns 1, as expected, since rg returned no results. I'm not sure if this is a problem with rg or the way fzf is reacting to rg returning an exit code of 1 (i.e.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |