-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvim
More file actions
26 lines (23 loc) · 1.23 KB
/
vim
File metadata and controls
26 lines (23 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
vke other text editors, you can’t code on it right away. You must think about what you want to do first, then write. Think twice, code once.
There are 2 important modes:
normal: Place for you to think about what you want to do. You will be spending 90% of your time in this mode.
insert: edit and make modifications.
To open a file, type vim path/to/file
If file doesn’t exist, a new one will be created for you when you save
Common commands in normal mode:
hjkl: these four keys are used as navigation keys to h-left j-up k-down and l-right, to move around the editor.
Going into insert mode:
o/O creates a new line below/above your cursor and puts you into insert mode
s deletes what is under the cursor and puts that place in the insert mode.
i/I allows you to insert the text at the cursor point/start of line.
a/A allows you to insert the text after the cursor point/end of line
cut and paste commands
D is used to cut the text in the editor line where the cursor is present.
P is used to paste the text which is cut by using the D command.
<number>command: Do command <number> times
5p - paste 5 times
save and exit command
:w to save the vim file.
:q to quit the vim editor.
:q! This vim command is like a force quit.
im has maily 3 modes...