02/06: Linux > vim / vi tips
Category: Linux tips
Posted by: hajime osako
A type appended text append after the line
y for copy and p for paste
To repeat a motion prepend it with a number: 2w
To move to the start of the line use a zero: 0
CTRL-G displays your location in the file and the file status.
G moves to the end of the file.
gg moves to the first line.
Typing ? followed by a phrase searches BACKWARD for the phrase.
N to search in the opposite direction.
CTRL-O takes you back to older positions, CTRL-I to newer positions.
CTRL-W CTRL-W to switch current window
CTRL-W c to close crrent window, more infor :help windows
Typing % while the cursor is on a (,),[,],{, or } goes to its match.
To ask for confirmation each time add 'c' :%s/old/new/gc
:!command executes an external command.
v motion :w FILENAME saves the Visually selected lines in file FILENAME.
Ctrl-v^jjjI#[space][esc]
:r FILENAME retrieves disk file FILENAME and puts it below the cursor position.
CTRL-n or CTRL-p in insert mode is for auto-complete.
more infor :help ins-completion
y for copy and p for paste
To repeat a motion prepend it with a number: 2w
To move to the start of the line use a zero: 0
CTRL-G displays your location in the file and the file status.
G moves to the end of the file.
gg moves to the first line.
Typing ? followed by a phrase searches BACKWARD for the phrase.
N to search in the opposite direction.
CTRL-O takes you back to older positions, CTRL-I to newer positions.
CTRL-W CTRL-W to switch current window
CTRL-W c to close crrent window, more infor :help windows
Typing % while the cursor is on a (,),[,],{, or } goes to its match.
To ask for confirmation each time add 'c' :%s/old/new/gc
:!command executes an external command.
v motion :w FILENAME saves the Visually selected lines in file FILENAME.
Ctrl-v^jjjI#[space][esc]
:r FILENAME retrieves disk file FILENAME and puts it below the cursor position.
CTRL-n or CTRL-p in insert mode is for auto-complete.
more infor :help ins-completion