Learning to Vim
denhamparry opened this issue · comments
Lewis Denham-Parry commented
Yet another guide as to how to use Vim and learnings from getting started
Lewis Denham-Parry commented
$ **vimtutor**
Lesson 1
Cursor
h
- leftj
- downk
- upl
- right
Exit
:!q
- trash all changes!wq
- save all changes
Characters
x
- delete the character next to the cursori
write something here - insert before the cursora
write something here - append after the cursor
Normal mode
<esc>
- enter Normal mode
Lewis Denham-Parry commented
Lesson 2
Delete
dw
- delete from cursor to next wordd$
- delete from cursor to the end of the linedd
- delete the whole line
operator [number] motion
- operator - what to do (e.g.
d
for delete) - [number] - optional count to repeat the step
- motion - moves over text to operate on (e.g.
w
for word,$
for end of line)
Motion
0
- move to start of the line
Undo
u
- undo previous actionsU
- undo all changes on a lineCTRL-R
- undo the undo
Lewis Denham-Parry commented
Lesson 3
Put
p
- Put the deleted text after tech cursor.
Replace
r
- Replace the following character.
change [number] motion
-
change - change from the cursor to where the motion takes you.
-
[number] - optional count to repeat the step
-
motion - moves over text to operate on (e.g. w for word, $ for end of the line)
-
e.g:
ce
- change from the cursor to the end of the word.c$
- change from the cursor to the end of the line.
Lewis Denham-Parry commented
Maybe instead of learning how to focus on how to