vim, switching between files rapidly using vanilla Vim (no plugins)

后端 未结 7 2002
南旧
南旧 2020-11-30 16:14

I understand that limiting myself to vanilla Vim (not using plugins) limits the power of the editor, but as I switch between different machines frequently, it is often too m

7条回答
  •  有刺的猬
    2020-11-30 16:39

    I had the same issue with Vim.

    The last thing I want is to depend on plugins for a task as mundane as file switching.

    I added the following lines to .vimrc

    set path+=**
    set wildmenu
    

    And BAM! I can now :find any/filename/in/any/folder/ as long as vim is in the root directory of the project. Tab completion works. Wildcards work!

    Once files are opened already, and there are a ton of buffers in the background (you could use :ls to see all buffers), running :b any/file will fuzzy search for all buffers and jumps to the required file. In case it is not unique there will be a wildmenu of tabs (hence the 2nd line in .vimrc) which can be selected using tab.

    My answer is coming from this awesome video
    https://www.youtube.com/watch?v=XA2WjJbmmoM&feature=youtu.be&t=489
    There are more tricks in and I recommend watching it.

提交回复
热议问题