How do you return from 'gf' in Vim

前端 未结 11 1075
执念已碎
执念已碎 2020-12-12 09:23

I am using Vim for windows installed in Unix mode. Thanks to this site I now use the gf command to go to a file under the cursor.

I\'m looking for a com

11条回答
  •  佛祖请我去吃肉
    2020-12-12 10:06

    I don't know the answer to part 2 of your question, but I can help with part 1. Use

    :e#
    

    Vim maintains a list of files (buffers) that it's editing. If you type

    :buffers
    

    it will list all the files you are currently editing. The file in that list with a % beside it is the current file. The one with the # beside it is the alternate file. :e# will switch between the current and alternate file. Rather than type that much, I map F2 to :e# so I can easily flip between the current and alternate files. I map the command to F2 by adding this to .vimrc

    nmap ` :e#`
    

提交回复
热议问题