Thursday, September 10, 2009

Search current word in vi, and some others

Emacs guy has to use vi sometimes. Search word under cursor:
*
# (reverse)
--
0 : move to beginning of the line
$ : -----------end----
f(F): find a character in the line (fa)

some other commands [update: 10/27/09]:

nG : move to line #n, or G to end of the file
:n : move to line #n
:$ : move the end of the file
1G or [[ : move to first line of the file
G or ]] : ----------last-----
n+: move cursor to next n lines
n-: -------------------last-------
u : undo last command

ma: set a mark 'a' here, use 'a to move here later

No comments:

Post a Comment