Open a buffer as a vertical split in VIM

后端 未结 6 1077
醉酒成梦
醉酒成梦 2021-01-29 17:35

If you are editing a file in VIM and then you need to open an existing buffer (e.g. from your buffer list: :buffers) how can you open it in a vertical split?

<
6条回答
  •  滥情空心
    2021-01-29 17:54

    The answer to the OP that I found most useful is embedded deep in Jerinaw's answer and a comment on it, and in Wolfson's answer. But I felt it might be brought out more. (Nor have those been voted most highly, even though they seemed to me the ones that answered OP best.)

    The answer to the question, Why is there not :vsbuffer, is that there is. It's called :vsplit and does the trick either as

    :vsplit NameOfBuffer

    OR

    :vsplit #NumberOfBuffer.

    (In this second use, take care to note that the hash # is significant. If you want to get to buffer number 3, you need to say :vsplit #3, not just :vsplit 3 which will instead create a new file named "3".)

    Again, this answer is embedded above, it's just not brought out clearly enough for the quick scanner, IMV.

提交回复
热议问题