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

后端 未结 7 2032
南旧
南旧 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:34

    The answer depends a lot on your preferences and circumstances. Some examples:

    • If it's mostly two files (e.g. a C header and implementation file), is very handy. In general, the alternate file is an important concept.
    • If you use a large editor window, window :splits turn the problem of locating a buffer from locating the window (once you've got all buffers opened). You can use [N] to quickly switch to it.
    • If you can memorize (a few) buffer numbers, the :[N]b[uffer] and :[N]sb[uffer] commands are quite handy; :ls tells you the numbers.

    Plugins (or at least custom mappings) can improve things a lot, and there's a whole variety on this topic on vim.org. There are various mechanisms to distribute your config (Pathogen + GitHub, Dropbox, ...), or you could remotely edit server files through the netrw plugin that ships with Vim.

提交回复
热议问题