Changing the practice of quiting and opening vi (vim) editor?

后端 未结 5 693
灰色年华
灰色年华 2021-02-11 07:05

One of the primary distinction betweeen vi (vim) and emacs, is emacs is designed and supposed to be run at times without quitting, where as given the quick load time of vim, it

5条回答
  •  春和景丽
    2021-02-11 07:20

    Everything the others said plus three:

    • With set hidden you can open a new buffer in place of the current one, even if it's not saved. You can open dozens of buffers like that, no need to close Vim! See :help windows or the Vim wiki.

    • Supposing Vim is compiled with the correct flag (+clientserver) you can have a single Vim running as a "server" (in a terminal window A) and open all your files in that single Vim (from terminal window B). It's done in two steps:

      1. $ vim --servername WHATEVER to start Vim
      2. $ vim --remote file.js to open a file

      Your file is opened in Vim in terminal window A and you still have your prompt in terminal window B.

    • Don't touch tabs. They are terribly wrongly named and don't work like tabs at all.

提交回复
热议问题