Say I've got three splits open with code in, and I suddenly want to make the one I'm in fullscreen, temporarily. How can I do that?
2 Answers
When focused on it, run:
:tabe %
To open a new tab with the same file. You can navigate tabs with gT
and gt
among other, if you want to go back to your split.
Once you are done with it, on the "fullscreen" one, run:
:q
to close the tab (technically closes the focused window, which is the only one of the tab, and closing the last window of the tab closes the tab).
If your splits are vertical you can press Ctrl-w|
to maximize the focused window.
If splits are horizontal then press Ctrl-w_
. To resize the splits press Ctrl-w=
-
1This is good, but unfortunately doesn’t preserve exactly the original layout– D. Ben Knoble ♦Commented May 1, 2019 at 17:30