User Tools

Site Tools


snippets:vim:shortcuts

Table of Contents

tabs

  • open
    • vim -p
    • :tab split
  • close
    • tabclose
  • next
    • normal mode: gt
    • :tabn
  • prev
    • normal mode: gT
    • :tabp

split

 :e filename      - edit another file
 :split filename  - split window and load another file
 ctrl-w up arrow  - move cursor up a window
 ctrl-w ctrl-w    - move cursor to another window (cycle)
 ctrl-w_          - maximize current window
 ctrl-w=          - make all equal size
 10 ctrl-w+       - increase window size by 10 lines
 :vsplit file     - vertical split
 :sview file      - same as split, but readonly
 :hide            - close current window
 :only            - keep only this window open
 :ls              - show current buffers
 :b 2             - open buffer #2 in this window

resize

:resize 60
:res +5
:res -5
:vertical resize 80
:vertical resize +5
:vertical resize -5

editing

  • dgg delete to beginning of file
  • dG delete to end of file

insert

To do this, move to the a in the first line, then press Ctrl-V (or Ctrl-Q if you use Ctrl-V for paste), then jj to select a visual block over three lines.

Now type I to start a special form of insert mode, then type the wanted text (s:). When you press Esc to exit from insert mode, the text will be inserted in the same position on each of the lines affected by the visual block selection. 
snippets/vim/shortcuts.txt · Last modified: by allspark