Find a file (via recursive directory search) in Vim

后端 未结 15 1244
感情败类
感情败类 2020-12-22 18:42

Is there any way to search a directory recursively for a file (using wildcards when needed) in Vim? If not natively, is there a plugin that can handle this?

15条回答
  •  难免孤独
    2020-12-22 18:56

    Run:

    :args `find . -name '*xml'`
    

    Vim will run the shell command in backticks, put the list of files to arglist and open the first file. Then you can use :args to view the arglist (i.e. list the files found) and :n and :N to navigate forward and bacwards through the files in arglist. See https://vimhelp.org/editing.txt.html#%7Barglist%7D and https://vimhelp.org/editing.txt.html#backtick-expansion

提交回复
热议问题