Vi Commands
Vi Commands
#eletion Commands
dh dl db dw dB dW d$ d0 Delete one character backwards Delete one character forwards Delete one word backwards Delete one word forwards Delete one non-blank word backwards Delete one non-blank word forwards Delete to end of line Delete to beginning of line
#eletion Commands
# Equivalent to d$ (delete to end of line) dd Equivalent to d$ (delete entire line) C Equivalent to c$ (delete to end of line! enter input "ode) cc Equivalent to c$ (delete entire line! enter input "ode) $ Equivalent to dh (delete character backwards) x Equivalent to dl (delete character forwards)
Mo%ing !ro&nd in the 'istor( )ile , or * Move backward one line - or . Move forward one line # Move to line given b$ repeat count /string %earch backward for string 0string %earch forward for string n &epeat search in sa"e direction as previous 1 &epeat search in opposite direction of previous Miscellaneo&s Commands 4 'nvert ((twiddle() case of current character(s)) 5 *ppend last word of previous co""and! enter input "ode) %&un the fc co""and on the current line (actuall$! run the co""and fc -e $+,'%-*./-$+ED'T0&/-vi11)2 usuall$ this "eans run the full vi on the current line) ctrl*6%tart a new line and redraw the7ctd889
Character*+inding Commands
+x Move right to next occurrence of x )x Move left to previous occurrence of x tx Move right to next occurrence of x! then back one space Tx Move left to previous occurrence of x! then forward one space 2 &edo last character-finding co""and 3 &edo last character-finding co""and in opposite direction
7888ctd9current line on it2 good for when $our screen beco"es garbled) : 3repend 4 (co""ent character) to the line and send it to the histor$ file25678 useful for saving a co""and to be executed later without having to ret$pe it) ;x 'nsert expansion of alias 9x (see below))