Вопрос

I'm in the process of switching from ack to https://github.com/ggreer/the_silver_searcher because of speed issues. Everything would be fine except that I have a command in my vimrc that sets args to the results of an Ack search like so: :args `ack -l keywords`.

ag -l keywords

does the same thing in my terminal but when I run :args `ag -l keywords` it actually creates a file called `ag -l keywords` which is crazy because if I try to rm it it deletes all the files that the search matches.

Anyway my question is: Why does it work for one command but interprets another as a literal.

This question also deals with a similar issue but the way they solve it doesn't make sense or work for me. in vim, how to set "args" to the result of a "grep -l"?

Это было полезно?

Решение

The backticks should work no matter which command. Are you sure the ag command is accessible from within Vim (i.e. it's not just a shell alias or function)? Try executing

:echo executable('ag')

It should yield 1.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top