author | category | date | summary | title |
---|---|---|---|---|
Vim |
2016-07-28 |
Vim Basics |
insert
normal
You can use the cursor arrows, but there is also: h
, j
, k
, l
w
- Moves to the start of next word
e
- Moves to the end of the word
b
- Moves to the beginning of a word
Formula: <Num>i<character>
then Esc
30 hyphens: 30i-
then Esc
Use %
to go to the matching bracket
{}
- Braces
[]
- Brackets
()
- Parenthesis
0
- go to the beginning of the line
$
- go to the end of a line
*
- next
#
- previous
gg
or H
- Go to the beginning of a file
G
- Go to the end of a file
Go to 4th line:
:4
thenEsc
4G
Press /
and then the text you are searchng for
n
: Go to next occurance
N
: Go to previous occurance
o
: Insert and go to new line after
O
: Insert and go to new line before
x
: Removes character under the cursor
X
: Removes character before the cursor
d
+ ... : Deleting with movement
dw
: delete to the start of the next word
v
enters visual mode
u
to undo
ctrl + r
to redo
:help
.
: Repeats the previous command
yy
- yank(copy) a line
p
: paste after current position
P
: paste after current position