How to change order for :bnext and :bprevious in vim?

前端 未结 2 820
小鲜肉
小鲜肉 2021-01-18 00:08

In vim I\'m opening 3 files in buffers: A,B,C (in this order). I\'m going back to buffer B, I open buffer D (:e d) while being in B (so now I\'m in D). But when I use :bprev

相关标签:
2条回答
  • 2021-01-18 00:27

    I don't think it's possible to change the buffer list's order without some possibly dirty heavy lifting but there are quite a lot of buffer navigation plugins available.

    This one, from the list, seems to adress your problem perfectly.

    If you don't need to go to the previouser-previouser-previouser-previouser buffer, you might consider <C-^> to switch to the previous one.

    0 讨论(0)
  • 2021-01-18 00:42

    You can use the argument list. See :help :args.
    You can edit a file and put in the argument list easily with the :argedit command. The argument list behave exactly what you would like.
    You can use :n command to edit the next file in the argument list and :N (or :prev) to edit the previous. It's even shorter then :bp and :bn !

    +1 for editing the alternate file as @romainl said. It's really fast !

    0 讨论(0)
提交回复
热议问题