Find a file (via recursive directory search) in Vim

后端 未结 15 1157
感情败类
感情败类 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:09

    There is a find command. If you add ** (see :help starstar) to your 'path' then you can search recursively:

    :set path
    

    will show you your current path, add ** by doing something like

    :set path+=**
    

    then you can just type

    :find myfile.txt
    

    and it opens magically!

    If you add the set command to your .vimrc it'll make sure you can do recursive search in future. It doesn't seem to search dot directories (.ssh for example)

提交回复
热议问题