Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
VIM Quick Reference Card

VIM Quick Reference Card

Ratings: (0)|Views: 9|Likes:
Published by api-3744861

More info:

Published by: api-3744861 on Oct 15, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

VIM Quick Reference Card
Basic movement

h l k j............character left, right, line up, down b w.............................word/token left, right ge e.....................end of word/token left, right { }.............beginning of previous, next paragraph ( )...............beginning of previous, next sentence 0 gm.........................beginning, middle of line ^ $.........................\ufb01rst, last character of line

nG ngg...................line n, default the last, \ufb01rst n%........percentage nof the \ufb01le(nmust be provided) n|............................column nof current line

%.....match of next brace, bracket, comment, #define
nH nL............line nfrom start, bottom of window
M...............................middle line of window
Insertion & replace\u2192 insert mode

i a.........................insert before, after cursor I A....................insert at beginning, end of line gI..........................insert text in \ufb01rst column o O......open a new line below, above the current line rc...............replace character under cursor with c grc................like r, but without a\ufb00ecting layout R.............replace characters starting at the cursor gR.................like R, but without a\ufb00ecting layout cm.............change text of movement command m ccor S.............................change current line C............................change to the end of line s.....................change one character and insert ~......................switch case and advance cursor g~m............switch case of movement command m gum gUm ...lowercase, uppercase text of movement m

<m >m..........shift left, right text of movement m
n << n >>.......................shift nlines left, right
Deletion

x X..............delete character under, before cursor dm..............delete text of movement command m dd D.............delete current line, to the end of line J gJ........join current line with next, without space :rd\u2190\ue000.............................delete range rlines :rdx\u2190\ue000.............delete range rlines into register x

Insert mode

\u02c6Vc.............................. insert charc literally \u02c6Vn...................insert decimal value of character \u02c6A...................... insert previously inserted text \u02c6@.......same as \u02c6A and stop insert\u2192 command mode \u02c6Rx........................ insert content of registerx \u02c6N \u02c6P.............. text completion before, after cursor \u02c6W........................... delete word before cursor \u02c6U.......... delete all inserted character in current line \u02c6D............................ shift left one shift width \u02c6Kc1 c2................................ enter digraph

\ue003esc\ue004..............abandon edition \u2192command mode
Copying

"x............use register xfor next delete, yank, put :reg\u2190\ue000...............show the content of all registers :regx\u2190\ue000..............show the content of registers x ym...........yank the text of movement command m yyor Y...................yank current line into register p P...........put register after, before cursor position ]p [p...................like p, Pwith indent adjusted gp gP...........like p, Pleaving cursor after new text

Advanced insertion
g?m..........perform rot13 encoding on movement m
n\u02c6A n\u02c6X.............. +n,\u2212nto number under cursor

gqm.......format lines of movement mto \ufb01xed width :rcew\u2190\ue000...........center lines in range rto width w :rlei\u2190\ue000.......left align lines in range rwith indent i :rriw\u2190\ue000......right align lines in range rto width w !mc\u2190\ue000 .\ufb01lter lines of movement mthrough command c

n!!c\u2190\ue000..............\ufb01lter nlines through command c
:r!c\u2190\ue000.........\ufb01lter range rlines through command c
Visual mode

v V\u02c6V..start/stop highlighting characters, lines, block o...exchange cursor position with start of highlighting gv...........start highlighting on previous visual area aw as ap.......select a word, a sentence, a paragraph ab aB...................select a block ( ), a block { }

Undoing & repeating commands
u U......undo last command, restore last changed line
.\u02c6R................repeat last changes, redo last undo
n.......repeat last changes with count replaced by n

qc qC....record, append typed characters in register c q.......................................stop recording @c....................execute the content of register c @@........................repeat previous @command :@c\u2190\ue000............execute register cas anEx command :rg/p/c\u2190\ue000..........executeEx command con range r

\ue002where patternp matches
Complex movement

- +.........line up/down on \ufb01rst non-blank character B W...................space-separated word left, right gE E...........end of space-separated word left, right

n........down n\u22121 line on \ufb01rst non-blank character

g0............................beginning ofscreen line g^ g$................\ufb01rst, last character ofscreen line gk gj............................screenline up, down fc Fc..........next, previous occurence of character c tc Tc.............before next, previous occurence of c ; ,.............repeat last fFtT, in opposite direction [[ ]]..............start of section backward, forward [] ][...............end of section backward, forward [( ]).................unclosed (, ) backward, forward [{ [}................unclosed {, }backward, forward [m ]m....start, end of backward, forward java method [# ]#.unclosed #if, #else, #endifbackward, forward [* ]*..........start, end of /* */backward, forward

Search & substitution

/s\u2190\ue000 ?s\u2190\ue000.............search forward, backward for s /s/o\u2190\ue000 ?s?o\u2190\ue000.....search fwd, bwd for swith o\ufb00set o nor /\u2190\ue000.....................repeat forward last search Nor ?\u2190\ue000...................repeat backward last search # *...search backward, forward for word under cursor g# g*.............same, but also \ufb01nd partial matches gd gD...local, global de\ufb01nition of symbol under cursor :rs/f /t/x\u2190\ue000..............substitute fby tin range r

\ue002x:g\u2014all occurrences,c\u2014con\ufb01rm changes
:rsx\u2190\ue000...........repeat substitution with new r& x

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->