Sławosz
Sławosz

Reputation: 11687

Open before opened buffer in vertical window in vim

I have two opened buffers (i.e. A and B) and one window. Currently I see A, I would like to open B in vertical window. To do it in horizontal window I can hit Ctrl+w ^, how to do it in vertical window? And how to change horizontal windows to vertical windows?

Upvotes: 4

Views: 250

Answers (3)

Xavier T.
Xavier T.

Reputation: 42188

To display your two buffers vertically, you can use :
:vsplit #
or the short version
:vs #

To reorganize your layout from horizontal to vertical, you must use:
<C-W>K : will move the current windows to to the top with a horizontal split
<C-W>J : will move the current windows to to the bottom with a horizontal split

<C-W>H : will move the current window to the the left with a vertical split
<C-W>L : will move the current window to the the rigth with a vertical split

See :help windows.txt for more information

Upvotes: 4

eckes
eckes

Reputation: 67047

  • open a vertical split: :vs
  • go to that split (assuming it's on the right: CTRL-W l
  • open buffer B there: :b B

Upvotes: 2

Neera
Neera

Reputation: 1587

You may use Vertical Split

Ctrl+Wv

command line :vertical split

Upvotes: 2

Related Questions