
-
gg moves to the beginning of the buffer.
G moves to the end of the buffer.
: followed by a line number themoves to that line number . -
typing / followed by a pharse searches FORWARD for the pharse.
typing ? followed by a pharse searches BACKWORD for the pharse.
After a search type n to find the next occurrence in the same direction
or N to search in the opposite direction. -
typing % while the cursor is on a(,),[,],{,or} locates its matching pair.
-
To substitute new for the first old on a line type :s/old/new
To substitute new for all ‘old’s on a line type :s/old/new/g
To substitute phrases between two line #’s type :#,#s/old/new/g
To substitute all occurrences in the file type :%s/old/new/g
To ask for confirmation each time add ‘c’ :%s/old/new/gc -
To save part of a file type :#,# w filename
-




近期评论