Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim getting split screen layout back after maximizing one split window [closed]

Tags:

vim

So I did a vertical split and maximized one of the split window using CNTRL+| . Now how do I make it go back to the same size ?

EDIT: Let me elaborate my question , suppose I have a layout like this

------------------
| one     | two  |
|-----------------
|three    | Four |
------------------

In the above layout I maximize window three to capture entire screen size. Now if I just want to have three and four in split view with "one" and "two" minimized, how can that be done ?

like image 424
Vihaan Verma Avatar asked Oct 28 '12 19:10

Vihaan Verma


People also ask

How do I unsplit a window in Vim?

If you want to reset the size of all split windows, use “Ctrl + W”, then “=”. It's also possible to tell the size of the split. By default, Vim offers equal width/height of each split.

How do I move a split screen in Vim?

To split the vim screen horizontally, or open a new workspace at the bottom of the active selection, press Ctrl + w , followed by the letter 's' . In the example below, the left section has been split into two workspaces. To navigate to the bottom section hit Ctrl + w , followed by the letter 'j' .

How do I minimize a window in Vim?

You can open this dialog and enter CTRL-ALT-Z as the shortcut key by selecting the shortcut key box and typing the key combination. Doing so allows you to press CTRL-ALT-Z to bring Vim to the foreground after launching it, and press CTRL-Z to minimize.


2 Answers

If you didn't do any resizing between the creation of the vertical split and <C-w>|, <C-w>= will return you to an "equalized" layout.

If you did some resizing you are out of luck as Vim doesn't keep a "resize history".

See :help windows.

like image 108
romainl Avatar answered Sep 22 '22 08:09

romainl


If it's just the two windows, Ctrl-W = will make both the same width again, but if you have more windows, their size might be affected by this, too. If you have mouse support (e.g. in GVIM), you also just drag around the window border to resize.

like image 27
Ingo Karkat Avatar answered Sep 18 '22 08:09

Ingo Karkat