How do you return from 'gf' in Vim

前端 未结 11 1080
执念已碎
执念已碎 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-12 10:16

    When you open a new file (with gf or :n or another command) the old file remains in a buffer list. You can list open files with :ls

    If you want to navigate easily between buffers in vim, you can create a mapping like this:

    nmap  :bN
    nmap  :bn
    

    Now you can switch between buffers with Alt + left arrow or Alt + right arrow.

    The complete documentation on mappings is here:

    :help map.txt
    

提交回复
热议问题