Freecodecamp article
Neovim install
Devhints Vim Cheatsheet
command | description |
---|---|
: |
go to command mode from normal mode |
Esc | go back to normal mode |
:q |
close file |
:qa |
close all file |
:q! |
exit and ignore changes |
:wq |
exit and save changes |
:!ls |
run terminal command ls without leaving vim |
command | description |
---|---|
i |
insert mode |
a |
insert mode - insert after current character |
o , O |
insert mode - insert into new line below |
I |
insert mode - insert into beginning of this line |
A |
insert mode - insert into end of this line |
Move inside the code:
- cursor buttons
- or
h
,j
,k
,l
Move inside the code, multiple steps:
3h
,4j
,5k
,2l
, etc.- or
3
⬇️ etc.
command | description |
---|---|
w | beginning of next word |
b | previous beginning of word |
e | end of word |
W | beginning of next word after a whitespace |
B | beginning of previous word before a whitespace |
E | end of word before a whitespace |
0 | the beginning of the line |
$ | the end of the line |
by command:
command | description |
---|---|
:set number |
add line numbers to the editor |
:set relativenumber |
add line numbers relative to the actual line |
:set mouse=a |
enable mouse clicks |
by file:
vi ~/.vimrc