Vi

From TestimonyofThomas
Jump to navigation Jump to search

2007-04-27 16:46:52

I can learn vi. I can learn vi. I can learn vi. I can learn vi.

If this page has any future, my vision for it is as the shortest vi guide ever.

Quitting

q! Quit without save (quit!)
wq Exit with save (write quit)

Typing

i Hello world! Types Hello world! and finishes the typing mode or command.

But why can't I go to the end of a line and type *after* the last character?

How am I supposed to delete things I type?

hjkl means <- ^ v -> (left, up, down, right)

$ End (of line)

0 Home (of line)

ctrl-f Page down

ctrl-b Page up

567G Go to line 567

% Go to matching brace

Copying and moving text

ma Mark point a

y'a Copy (yank) from here to a into the clipboard buffer

p Paste from clipboard buffer

Searching

set ic Set ignore case
set noic Set no ignore case

/ Search

n Next occurrence

N Previous occurrence

%s/search/replace/g Replace global in file (%) and all on every line (g)