User Tools

Site Tools


snippets:vim:shortcuts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
snippets:vim:shortcuts [2015/02/14 14:46] allsparksnippets:vim:shortcuts [2018/05/29 14:55] (current) allspark
Line 13: Line 13:
  * normal mode: gT  * normal mode: gT
  * :tabp  * :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 # editing
Line 18: Line 47:
 * dgg delete to beginning of file * dgg delete to beginning of file
 * dG delete to end 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.1423921583.txt.gz · Last modified: by allspark