Find a file (via recursive directory search) in Vim

后端 未结 15 1243
感情败类
感情败类 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 19:05

    Depending on your situation (that is, assuming the following command will find just a single file), perhaps use a command like:

    :e `locate SomeUniqueFileName.java`
    

    This will cause Vim to open, in the current tab (the e command) a file that is the result of running (in this example),

    locate SomeUniqueFileName.java
    

    Note that the magic here is the backticks around the command, which will convert the output from the shell command into text usable in the Vim command.

提交回复
热议问题