Skip to content
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

Not an editor command when passing vertical bar (or) through --query #782

Closed
3 of 9 tasks
rcywongaa opened this issue Mar 19, 2019 · 1 comment
Closed
3 of 9 tasks
Labels

Comments

@rcywongaa
Copy link

  • Category
    • Question
    • Bug
    • Suggestion
  • OS
    • Linux
    • macOS
    • Windows
    • Etc.
  • Vim
    • Vim
    • Neovim

I am trying to use fzf as a replacement for FSwitch for switching between header and source files

For that, I have the following line in my .vimrc

nnoremap :call fzf#vim#files('.', {'options':['--query', expand("%:r").' h$ | hpp$ | cpp$ | c$']})

However, sourcing this gives me the following error

E492: Not an editor command:  hpp$ | cpp$ | c$']})<CR>

It seems like the pipe is causing an issue. How do I correctly pass the vertical bar to the query?

Running the command directly in vim (without keybinding) works though

:call fzf#vim#files('.', {'options':['--query', expand("%:r").' h$ | hpp$ | cpp$ | c$']})<CR>
@junegunn
Copy link
Owner

See :help map-bar. I would just define a function that calls fzf#vim#files and call it instead to avoid the "escaping" issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants