fw

bw

MOVE

 

 

w

b

word (spc,punc)

 

 

E

B

word, space separated

 

 

{

}

paragraph

 

 

®

-

start neighb. line

 

 

0

$

this physical line

 

 

^

$

this logical line

 

 

©F

©B

screen

 

 

©D

©U

½ screen

 

 

1G

G

begin/end of file

 

 

nG

line number n

 

 

©G

report line number

 

 

mx

mark cur pos as x

 

 

`x

go to mark x

 

 

``

return to prev mark

 

 

©A

 

occur. of cur cursor word

 

 

 

 

MOVE w.o. scroll

 

 

L   M   H

to screen posn

 

 

 

 

SCROLL w.o. move

 

 

©E

©Y

line

 

 

   z.   z-

cur line to screen posn

 

 

 

 

SEARCH

 

 

/pat

?pat

new search

 

 

n

n

repeat last  (N = opp. direction)

 

 

fx

Fx

character x in cur line

 

 

tx

Tx

before/after chr x in cur line

 

 

;

,

repeat prev f F or t

 

 

%

%

partner of current bracket

 

 

 

 

START TYPING

 

 

a

i

after/before cursor

 

 

A

I

end/begin of line

 

 

o

O

new line above/below

 

 

r

 

type over one char

 

 

cw

 

type over word

 

 

cm

 

typeover until target move

 

 

C

 

typeover until end of line

 

 

R

 

start type over

 

 

©T

©D

incr/decr typing indent

 

 

>>

<<

incr/decr indent of line

 

 

>m

<m

i/d ident all until move cmd

 

 

 

 

DELETE / COPY / PASTE

 

 

x

X

delete one character

 

 

dw

 

one word

 

 

dd

 

entire line

 

 

D

 

up to end of line

 

 

dm

 

up to target of move cmd

 

 

yw

 

copy word

 

 

yy

 

copy entire line

 

 

ym

 

copy until target of move

 

 

p

P

paste after/before cursor

 

 

a

 

prefix to use buffer a-z

 

 

A

 

prefix to append buffer a-z

 

 

:a,bd

delete lines a to b

 

 

:a,bmc

move a to b to after line c

 

 

:a,bcoc

copy a to b to after line c

 

 

J

 

go to end line and join next

 

 

 

 

UNDO etc

 

 

.

repeat last edit

 

 

u

undo last edit

 

 

U

revert current line

 

 

:e!

revert file

 

 

@x

execute cmd in buffer x

 

 

 

 

SEARCH and REPLACE

 

 

:s/old/new/flags

 

 

 

:a,bs/old/new/flags

 

 

 

:g/pat//old/new/flags

 

 

 

 

flags: g-all on line; p-print; c-confirm

 

 

 

 

PATTERNS

 

 

$

^

(at end) end/start of a line

 

 

.

any char

 

 

*

any reps of previous

 

 

[abc]

any one of abc

 

 

[^abc]

one of anything but abc

 

 

\>

\<

end/begin of word (spc/punc)

 

 

\( ... \)

save this match

 

 

~

pattern from last search

 

 

 

 

SUBSTITUTIONS

 

 

\n

nth \(...\) save

 

 

&

entire match

 

 

~

subst from last search

 

 

\u

\l

upper/lower casify next char

 

 

 

 

LINE NUMBERS in : cmds

 

 

1   .   n   $

1st current nth last line of file

 

 

+n

-n

n lines ahead or back

 

 

%

equivalent to 1,$

 

 

/pat/

?pat?

line containing pat

 

 

`x

``

line marked x / prev mark

 

 

 

 

SYSTEM

 

 

!lc

rep cur (non blank) line w cmd

 

 

:rfile

insert file contents

 

 

ZZ

save and exit

 

 

:q!

abandon and exit

 

 

:n

move on to next file (on cmd ln)