Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open before opened buffer in vertical window in vim

Tags:

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?

like image 362
Sławosz Avatar asked Feb 25 '23 06:02

Sławosz


2 Answers

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

like image 76
Xavier T. Avatar answered Mar 08 '23 05:03

Xavier T.


You may use Vertical Split

Ctrl+Wv

command line :vertical split

like image 23
Neera Avatar answered Mar 08 '23 05:03

Neera