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

后端 未结 5 673
灰色年华
灰色年华 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:08

    So you're running one file Vim per screen session? That sounds pretty bad man. You don't really need any special plugins to use multiple files in Vim easily. Just do

    :e /home/project/myfile.py
    

    I have set autochdir in my .vimrc which automatically changes current working directory to whatever buffer is currently active. So once you have that file open you can just do

    :e myfile2.py
    :e myfile3.py
    

    etc. BTW opening any files in Vim can be completed with tab completion so make sure you are doing that. Once you have a bunch of buffers open to switch between I just do

    :b myfile1.py
    

    which you can also use tab completion for you can just type :b 1 and hit tab and it will figure out you want myfile1.py open so it is super quick if you can remember the general file name and if there is more than one similar match it will give you a list that you can tab through. For that I would also advise taking a look at the wildmode and wildmenu settings to see what you prefer they will give you enhanced tab completion menus. If at any time you start getting lost with what buffers are open and what you want to look at you can just do

    :ls
    

    and it will show you everything open.

    Also remember you can run external commands by preceding a command with !

    :!ls
    

    for example. Hope some of this helps or at least gets you looking in the right direction.

提交回复
热议问题