| BASIC MOVEMENT/DELETE COMMANDS |
| Command |
Item |
Forward |
Backward |
Repeat (1) |
| move |
character |
 |
 |
n |
| delete |
|
x |
X |
y |
| move |
word start (2) |
w |
b |
n |
| |
word end |
e |
|
n |
| delete |
word |
dw |
db |
y |
| move |
line |
$ |
0 |
n |
| delete |
|
d$ |
d0 |
y |
| move |
file |
G |
1G |
n |
| delete |
|
dG |
d1G |
y |
| move |
paragraph |
} |
{ |
n |
| delete |
|
d} |
d{ |
y |
| Absolute/Relative Direction |
| Command |
Item |
OpCode |
Action |
Repeat (1) |
| go to |
line |
:line_no |
absolute line no. |
n |
| delete |
range |
:n1,n2d |
absolute line range n1<n2 |
n |
| |
|
:.,+nd |
relative line range form here to n |
n |
| go to |
lines |
 |
move +n or -n lines from here |
n |
| delete |
lines |
d |
delete one line at +n or -n lines from here |
n |
| Using Markers |
| Command |
Item |
OpCode |
Action |
Repeat (1) |
| go to |
marker |
`a (3) |
move from here to marker a |
n |
| |
|
'a (4) |
move from here to line marked a |
n |
| delete |
marker range |
d`a (3) |
delete from here to marker a |
n |
| |
|
d'a (4) |
delete from here to line marked a |
n |
| (1) - repeat character is . (dot) |
| (2) - use uppercase codes W, E, B for whole words |
| (3) - use backquote to select marked position |
| (4) - use quote to select marked line |
| BASIC SEARCH OPERATORS |
| Item |
Forward |
Backward |
Action |
Repeat Count |
| string |
/ |
? |
search string in file (1) |
n |
.* |
/ |
? |
use wild match search |
n |
| character |
f |
F |
search char in line (2) |
y |
| Repeat Search Operators |
| Item |
Operator |
Action |
Repeat Count |
| string |
n |
same direction of previous search |
n |
| |
N |
opposite direction of previous search |
n |
| character |
; |
same direction of previous search |
y |
| |
, |
opposite direction of previous search |
y |
| Setup Search Modifiers |
| setup |
Action |
:se nows |
inhibit circular search and stop when
EOF or BOF met |
:se ic |
ignore case of searched string, always match case of searched char |
| (1) - search strings are regular expressions |
| (2) - integer repeat count is prefixed to
search operator |
| n.b. - search operator is prefixed to search
item |
| BASIC SUBSTITUTE COMMANDS |
| Command |
Action |
Repeat count |
r |
overstrike one single character |
y |
R |
overstrike chars up to <esc> |
y |
cc |
replace line up to <esc> |
y |
cw |
replace word forward up to <esc> |
y |
cb |
replace word backward up to <esc> |
y |
s |
substitute char up to <esc> |
y |
:s/old/new/gc |
replace all occurence of regular expression old |
|
| |
with string new in current line with confirm |
n |
:50,100 s/old/new/gc |
as above on line range |
n |
:s |
unconditionally repeat previous string replace |
n |
:sc |
repeat previous string replace with confirm |
n |
| n.b. - use :se noic to force case
match |
| n.b. - use :se nu to display line
numbers |