move between windows
commands | shortcut |
---|---|
:wincmd l |
ctrl + w ⇢ l |
:wincmd h |
ctrl + w ⇢ h |
:wincmd j |
ctrl + w ⇢ j |
:wincmd k |
ctrl + w ⇢ k |
resize
reference:
- Resize splits more quickly
- maximium split window: ctrl + w ⇢ _
- maximium vsplit window: ctrl + w ⇢ |
- resize window: ctrl + w ⇢ |
horizontal resize
:res
is the shortcut of:resize
commands or shortcut | comments |
---|---|
:res n |
setup the width to |
:resize -n |
reduce |
:resize +n |
extend |
ctrl + w ⇢ + | extend 1 line |
:wincmd + |
extend 1 line |
ctrl + w ⇢ - | reduce 1 line |
:wincmd - |
reduce 1 line |
ctrl + w ⇢ = | resize to default: 50% |
:wincmd = |
resize to default: 50% |
ctrl + w ⇢ _ | maximum the window |
:wincmd _ |
maximum the window |
vertical resize
commands or shortcut | comments |
---|---|
:vertical res n |
setup the width to |
:vertical resize -n |
reduce |
:vertical resize +n |
extend |
ctrl + w ⇢ > | extend 1 column |
:wincmd > |
extend 1 column |
ctrl + w ⇢ < | reduce 1 column |
:wincmd < |
reduce 1 column |
ctrl + w ⇢ = | resize to default: 50% |
:wincmd = |
resize to default: 50% |
ctrl + w ⇢ | | maximum the window |
:wincmd ⎮ |
maximum the window |
quickfix
- automatically fitting a quickfix window height
.vimrc au FileType qf call AdjustWindowHeight(3, 10) function! AdjustWindowHeight(minheight, maxheight) exe max([min([line("$"), a:maxheight]), a:minheight]) . "wincmd _" endfunction