open command in a new window

[!TIP|label:reference:]

" :[N]new [++opt] [+cmd] {file}

:<n>command +<command>
" |    |        + the command will be execute
" |    + command to create new window. i.e.: new, vnew, split/sp, vsplit/vsp
" + line number or column number
n-new-command
1.3.7.1 -- n-new-command

move between windows

COMMANDS SHORTCUT
:wincmd l ctrl + wl
:wincmd h ctrl + wh
:wincmd j ctrl + wj
:wincmd k ctrl + wk
:wincmd r ctrl + wr

resize

[!NOTE|label: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[ize] n setup the width to lines
:res[ize] -n reduce lines of the width
:res[ize] +n extend lines of the width
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
split resize
1.3.7.2 -- split resize

vertical resize

COMMANDS OR SHORTCUT COMMENTS
:vertical res[ize] n setup the width to columns
:vertical res[ize] -n reduce columns of the width
:vertical res[ize] +n extend columns of the width
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
vertical split resize
1.3.7.3 -- vertical split resize

quickfix

quickfix windows
1.3.7.4 -- quickfix windows
  • 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
    
Copyright © marslo 2020-2024 all right reserved,powered by GitbookLast Modified: 2025-02-16 20:47:03

results matching ""

    No results matching ""