Vous êtes sur la page 1sur 2

VimCheatSheet

Global Editing Copy/CutandPaste Workwithmultiplefiles Tabs


:help Stichwort rReplacethesingle yyCopyline :e DateiEditthefile :tabnewOr :tabnew
Openshelpforthekeyword character inthenewbuffer Dateifileinnewtab
2yyCopy2lines
:o DateiOpensthefile Jaddthelinebelowthe :bnextOr :bnjumpto Ctrl+ wTmovethe
currentline ywCopytheword thenextbuffer currentlysplitwindowinits
:saveas DateiSave owntab
as... ccReplacethecomplete y$Copytoendofline :bprevOr :bpjumpto
line thepreviousbuffer gtOr :tabnextor
:closeClosesthe pPastetheclipboardafter :tabnjumptothenext
currentpanel cwReplaceuntiltheendof thecursor :bdDeletebuffer(close
tab
theword file)
Cursormovements PPastetheclipboardbefore gTOr :tabprevor
c$Replacetotheendofthe thecursor :lsListallopenbuffers
hMovecursoronecharacter line :tabpjumptothe
totheleft ddDelete(cut)thecurrent :sp DateiEditfilein previoustab
sDeleteandreplace line thenewbufferanddividethe
jMovecursordownone characters windowhorizontally #gtjumptothetabwith
line 2ddDelete(cut)of2lines #
SDeleteandreplacetheline (currentandfollowing) :vsp DateiEditthe
kMovecursoruponeline (likecc) fileinthenewbufferandsplit :tabmove #move
dwDeleteword(cutout) thewindowvertically currenttabto#position
lMovecursoronecharacter xpSwaptwocharacters (indexedfrom0on)
totheright (deleteandpaste) DDelete(cut)toendofline Ctrl+ wsDividethe
windowhorizontally :tabcloseOr :tabc
Hmovetotopofscreen uUndothechange d$Delete(cut)toendof currenttab,includingall
Ctrl+ wwChangethe windows
line
Mmovetomiddleofscreen Ctrl+ rRepeatthelast, window
undo,change xDeletecharacters(cutout) :tabonlyOr :tabo
Lmovetobottomofscreen Ctrl+ wqClosewindow closealltabsexceptthe
.Repeatthelastcommand Saveandexit currentone
wJumptothebeginningof Ctrl+ wvSplitthe
theword :wWritefile,butdonot windowvertically
:tabdoCommand
Selec tingtext(Visual commandforalltabs(eg:
mode) closeit
WJumptothewordstart Ctrl+ whcursorinthe :tabdo qclosesallopen
(wordcancontain vStartvisualmode,select :w !sudo tee % leftwindow(vertical tabs)
punctuation) lines,executecommand(like Writethecurrentfilewith division)
ycopy) sudo
eLeapforwardtotheend Ctrl+ wlCursorinthe
VStartlinebylinevisual :wqOr :xor ZZWriteand rightwindow(vertical
EJumptothewordend mode closethefile division)
(wordcancontain
punctuation) oJumptotheotherendof :qClosefile(failswith Ctrl+ wjcursorinthe
themark unsavedchanges) lowerwindow(horizontal
bJumpbacktothe division)
beginningoftheword Ctrl+ vblockStartvisual :q!Or ZQClosefileand
mode discardchanges Ctrl+ wkcursorinthe
Bjumpbackwardstothe upperwindow(horizontal
wordstart(wordcancontain OJumptotheotherblock division)
Searchandreplace
punctuation) corner
/patternSearchfor
0Jumptothebeginningof awSelecttheword patterns(forward)
theline
abBlockwith() ?patternsearchpattern
^Jumptothefirstcharacter (backwards)
oftheline aBBlockwith{}
\vpattern'verymagic'
$Jumptotheendofthe ibinnerblockwith() pattern:nonalphanumeric
line characterareinterpretedas
iBinnerblockwith{} regexsymbols(noescaping
g_Jumptothelastnon required)
emptycharacteroftheline EscExitthevisualmode
nRepeatsearch(same
ggJumptothebeginning CommandsinVisualMode direction)
ofthedocument
>Movethetexttotheright NRepeatsearch(opposite
GJumptotheendofthe direction)
document <Movetexttotheleft
:%s/old/new/g
5GJumptoline5 yCopyselectedtext Replacetheentiredocument

fxJumptothenext'x'on dDeleteselectedtext :%s/old/new/gc


theline Replacethepatterninthe
~Switchuppercase/ entiredocumentwith
txJumptothenext'x'on lowercase confirmation
theline
register :nohRemoveallmarkers
}Movetothenext fromsearchhits
paragraph(orfunction/block) :regshowthecontentsof
theregisters Searchinmultiplefiles
{Gototheprevious :vimgrep
paragraph(orfunction/block)
"xyCopytotheregisterx
/pattern/ {file}
zzcentercursoronscreen "xpInsertthecontentsof Patternsearchinmultiplefiles
thexregister
Ctrl+ bReturnascreen
Markings
page Markings
:cnjumptonextpattern
:marksListallmarkers (forward)
Ctrl+ fSkipascreen
Ctrl+ dContinuehalfa maCreatethemark'a'at :cpjumptothenext
thisposition pattern(backwards)
screen

Ctrl+ uReturnhalfa `aMovetothe'a' :copenOpenwindow


screen withlistofpatterns
y`aCopytotheposition
ofthemarking'a'
InputmodeInsert/attac h
text
Macros
iPastebeforethecursor
qaStartrecording'a'
IPasteatthebeginningof
theline qStoptherecording

aAppendbehindthecursor @aRunthemacro'a'

AAppendattheendofthe @@Executethelastmacro
line again

oPasteonanewline,
belowthecurrentline

OPasteonanewline,
abovethecurrentline

eaAttachattheendof
words

EscExittheinputmode

Vous aimerez peut-être aussi