Vim: Navigating to Previous and Next Buffers in Edit History

后端 未结 2 760
北恋
北恋 2020-12-15 06:20

When I edit multiple files I oftentimes want to go back and forth between the last edited files. I know about :bn(ext) and :bp(revious) to switch between b

2条回答
  •  鱼传尺愫
    2020-12-15 07:12

    I have been wanting the same functionality for quite some time now as well. Your question inspired me to finally do something about it. Have a look at bufsurf, a small plugin that provides the required functionality. It provides the user with two commands:

    :BufSurfBack 
    

    to navigate backwards in history, and similarly:

    :BufSurfForward
    

    to navigate forwards in history. For each window or tab a separate navigation history is kept in memory. Please let me know if you experience any problems, I did not have the chance to test this extensively yet.

提交回复
热议问题