Chapter 5: Splitting Windows and Tabs
November 15, 2023 ยท View on GitHub
Splitting Windows and Tabs
You will often encounter situations where you need to edit the current document with reference to another document (scenario: translation), or copy code from another document to the current document (scenario: copying html element class names to a css document). copy code from another document to the current document (scenario: copying html element class names to a css document), this is when you need to split the screen the most.
Splitting
:splitabbreviation:sporCtrl-w ssplit up and down.:vsplitAbbreviation:vsorCtrl-w vSplit left and right.:diffsplitAbbreviation:diffsDiff mode opens a split screen and can be followed by {filename}.
Window jumping
Ctrl-w wActivate next window.Ctrl-w jActivates the next window.Ctrl-w kActivate the upper window.Ctrl-w hActivate left windowCtrl-w lactivates the right window
Move split screen
Ctrl-w lMoves to rightmost windowCtrl-w HMoves to the leftmost side.Ctrl-w KMove to the topCtrl-w JMove to the bottom
_Note: Case sensitive. Alternatively, you can move the bottom screen to the right side for a top/bottom to left/right split screen conversion. _
Screen zoom
Ctrl-w =Average window sizeCtrl-w +Increase heightCtrl-w -Reduce heightCtrl-w _Maximum heightCtrl-w >Increase widthCtrl-w <Reduce widthCtrl-w |Maximum width
Practice! Practice! Practice!
Tagged pages
The buffer mentioned in Chapter 2 and the split-screen operation just mentioned are good for switching between a small number of files. I don't think it's convenient to have more than 3 files, but tabs are better for switching between multiple files.
Create a tab
:tabnewor:tabeditabbreviation:tabeopens a new tab.Ctrl-w gfopens a new tab with the name of the file at the current cursor position
Note: Both :tabnew and :tabedit can be followed by a : can be followed by a number indicating the position of the new tab in
the list (starting from 0). _
Switch tabs
gtor:tabnextAbbreviation:tabnNext tab (last one loops to first)gTor:tabpreviousAbbreviation:tabpPrevious tab (first one loops to last):tabrewindabbreviation:tabror:tabfirstabbreviation:tabfirto the first one:tablastabbreviation:tablto the last tab
Close a tab.
:tabcloseAbbreviation:tabcto close the current tab:-tabcClose previous tab:+tabcClose the next tab:tabonlyabbreviation:taboclose other tabs
The next chapter will cover block operations.