in vim, how to set “args” to the result of a “grep -l”?

前端 未结 2 1904
遇见更好的自我
遇见更好的自我 2021-02-14 06:08

To illustrate, here\'s how to do it from the command-line:

vim `grep \"hello\" * -Rl`

This opens vim with all the files that have \"hello\" in

相关标签:
2条回答
  • 2021-02-14 06:35

    Try the args command:

    :ar[gs] `grep -Rl "hello" .`
    

    If the backticks aren't working for you, are you use you're using a current version of vim?

    :version
    
    0 讨论(0)
  • 2021-02-14 06:49

    Well, this works for me:

    :args `grep -Rl "hello" *`
    

    Running vim 7.0.305.

    0 讨论(0)
提交回复
热议问题