Neovim Tutorial - QWERTY
Neovim Tutorial - QWERTY
2
October 7th, 2018 neovim/vim gr
Esc
normal
mode
~ toggle
case ! external
filter @· play
macro # prev
ident $ eol % goto
match
`· goto
mark 1 2
2 3 4 5
Q ex
mode W next
WORD E end
WORD R replace
mode T·
q· record
macro w next
word e end
word r· replace
char t·
A append
eol
at
S subst
line D delete
to eol F· find
"back"
char
a append s d f· char
1,3
subst delete find
char
Z· quit
4
X back-
space C change
to eol V visual
lines
z· extra
cmds
5
x delete
char c change
1,3
v visual
mode
special functions,
extra
requires exta input
q· commands with a dot need
a char argument afterwards
words: q u u x ( f o o , b a r , b a z )
WORDs: q u u x ( f o o , b a r , b a z )
goto
match ^ "soft"
bol & repeat
:s * next
ident ( begin
sentence ) end
sentence _
6 7 8 9 0 "hard"
bol -
T· back
'till Y yank
line U undo
line I insert
at bol O open
above P paste
before
t· y u i o p 1
1,3 insert open paste
'till yank undo
mode below after
G· gotoeof/line H screen
top J join
lines K help L screen
bottom : ex cmd
line
g· extra
cmds
6
h ⬅ j ⬇ k ⬆ l ➡ ; repeat
t/T/f/F
visual
lines B back
WORD N prev
(find) M screen
mid'l < indent
un- 3
> indent
3
?·
visual
mode b back
word n next
(find) m· set
mark , reverse
t/T/f/F . repeat
cmd /·
- prev
line = auto 3
format
{ begin
parag } end
parag
[· misc ]· misc
ex cmd
line "· spec
reg. 1
| bol/
goto col
repeat
t/T/f/F '· mk.gotobol \· default
leader
find
(rev.)
find
/paste/del command
clipboard') (x=a..z,*)
st of line to register 'a')
$ eol
W next
WORD E end
WORD R replace
mode
w next
word e end
word
A append
eol
at
X back-
space
x delete
char
Basics: Extras:
h j k l are neovim cursor keys - use them as they are much u to undo the last action
closer than regular cursor keys! undo (CTRL-
Use i to enter insert mode, cursor turns from a block into a vertical 0 jumps directly to the
line, and you can type in text. U Esc to return to normal mode. and ^ to the first non-b
(Note: insert mode is actually very similar to a regular editor, you can use Use R to enter insert m
cursor/navigation keys, backspace, delete...) types over existing char
^ "soft"
bol
0 "hard"
bol
u undo i insert
mode
: ex cmd
line
h ⬅ j ⬇ k ⬆ l ➡
B back
WORD
b back
word
$ eol
1 2 3 4 5
W next
WORD E end
WORD R replace
mode T·
w next
word e end
word t·
A append
eol
at
F· find
"back"
char
d delete f· char
find
X back-
space V visual
lines
x delete
char c change v visual
mode
Basics: Extras:
f , followed by another key, moves the cursor to the next instance Prepend a count to any
of that character on the current lin F does the same backwards. of times:
t and T do the same, but they stop right before the character. d 2 w to delete up to th
d 2 t , to delete up to
d (delete) followed by any motion, deletes the text between the 2 i repeats the text aft
cursor and that motion's destinati ( d w , d f - ...).
Repeat operator
c (change) does the same, but leaves you in insert mode.
V enters visual-lines mo
Some motions, such as j and k , are linewise - deletion includes
the full start/end lines. CTRL- v selects rectang
. repeats the last editing action: text input, delete or change, etc...
motion is recalculated at the new place.
^ "soft"
bol
6 7 8 9 0 "hard"
bol
T· back
'till
: ex cmd
line
h ⬅ j ⬇ k ⬆ l ➡
visual
lines B back
WORD
visual
mode b back
word . repeat
cmd
$ eol
1 2 3 4 5
W next
WORD E end
WORD R replace
mode T·
w next
word e end
word t·
A append
eol
at
F· find
"back"
char
d delete f· char
find
X back-
space V visual
lines
x delete
char c change v visual
mode
Basics: Extras:
Text deleted withy , c , x ... is also copied! O does the same above
^ "soft"
bol
6 7 8 9 0 "hard"
bol
T· back
'till O open
above P paste
before
: ex cmd
line
h ⬅ j ⬇ k ⬆ l ➡
visual
lines B back
WORD
visual
mode b back
word . repeat
cmd
special functions,
requires extra input
version 2.2
October 7th, 2018 neovim/vim le
Esc
normal
mode
# prev
ident $ eol
1 2 3 4 5
W next
WORD E end
WORD R replace
mode T·
w next
word e end
word t·
A append
eol
at
F· find
"back"
char
d delete f· char
find
X back-
space V visual
lines
x delete
char c change v visual
mode
Basics: Extras:
/ is the basic search motion - type the text you are searching for The following very usefu
after the slash, and the press return. Being a motion, you can use
this after an operator, or in visual mode. * searches forward for
the cursor.
? does the same, backwards.
# does the same backw
n repeats the last search in the same direction
N repeats it in the reverse direction
^ "soft"
bol * next
ident
6 7 8 9 0 "hard"
bol
T· back
'till O open
above P paste
before
: ex cmd
line
h ⬅ j ⬇ k ⬆ l ➡
visual
lines B back
WORD N prev
(find) ?·
visual
mode b back
word n next
(find) . repeat
cmd /·
find
(rev.)
find
special functions,
requires extra input
version 2.2
October 7th, 2018 neovim/vim lesso
Esc
normal
mode
@· play
macro # prev
ident $ eol
`· goto
mark 1 2 3 4 5
W next
WORD E end
WORD R replace
mode T·
q· record
macro w next
word e end
word t·
A append
eol
at
F· find
"back"
char
d delete f· char
find
X back-
space V visual
lines
x delete
char c change v visual
mode
Marks: Macros:
Use ' and a character to go to the first non-blank in that line. @ followed by a charact
^ "soft"
bol * next
ident
6 7 8 9 0 "hard"
bol
T· back
'till O open
above P paste
before
: ex cmd
line
h ⬅ j ⬇ k ⬆ l ➡
visual
lines B back
WORD N prev
(find) ?·
visual
mode b back
word n next
(find) m· set
mark . repeat
cmd /·
special functions,
to repeat the last macro played. extra requires extra input
Emu, vi/vim emulation for Microsoft Visual Studio
ex cmd
line "· reg.
spec
'· goto
mk. bol
find
(rev.)
find
special functions,
requires extra input
version 2.2
October 7th, 2018 neovim/vim lesso
Esc
normal
mode
@· play
macro # prev
ident $ eol % goto
match
`· goto
mark 1 2 3 4 5
W next
WORD E end
WORD R replace
mode T·
q· record
macro w next
word e end
word t·
A append
eol
at
F· find
"back"
char
d delete f· char
find
X back-
space V visual
lines
x delete
char c change v visual
mode
G jumps to the end of the file, or to the line # typed before it. [ [ jumps to the previo
K , not technically a motion, jumps to the help for the word under
the cursor: neovim help, man page, etc...
Google Doc version by mattmc3 https://github.com/mattmc3/neovim-cheatsheet
Credit to www.viemu.com for design For tutorial and fulll cheat sheets, go to www.viemu.com - home of ViEmu, vi/vim emulation for Micr
/vim lesson 6 - various motions
goto
match ^ "soft"
bol * next
ident ( begin
sentence ) end
sentence
6 7 8 9 0 "hard"
bol -
T· back
'till O open
above P paste
before
G· gotoeof/line H screen
top K help L screen
bottom : ex cmd
line
h ⬅ j ⬇ k ⬆ l ➡
visual
lines B back
WORD N prev
(find) M screen
mid'l ?·
visual
mode b back
word n next
(find) m· set
mark . repeat
cmd /·
special functions,
extra requires extra input
Emu, vi/vim emulation for Microsoft Visual Studio
+ next
line
- prev
line
{ begin
parag } end
parag
[· misc ]· misc
ex cmd
line "· reg.
spec
'· goto
mk. bol
find
(rev.)
find
special functions,
requires extra input
version 2.2
October 7th, 2018 neovim/vim lesson
Esc
normal
mode
~ toggle
case @· play
macro # prev
ident $ eol % goto
match
`· goto
mark 1 2 3 4 5
W next
WORD E end
WORD R replace
mode T·
q· record
macro w next
word e end
word r· replace
char t·
A append
eol
at
S subst
line D delete
to eol F· find
"back"
char
s subst
char d delete f· char
find
X back-
space C change
to eol V visual
lines
x delete
char c change v visual
mode
Basics: Extras:
J joins the current line with the next one, or all the lines in the > and a motion to inden
current visual selection.
< and a motion to unind
r followed by any character replaces the current character with
that one. = and a motion to refor
s deletes the character under the cursor and enters insert mode. Now go grab the fu
Start with
S clears the current line and enters insert mode.
goto
match ^ "soft"
bol * next
ident ( begin
sentence ) end
sentence
6 7 8 9 0 "hard"
bol -
T· back
'till Y yank
line O open
above P paste
before
G· gotoeof/line H screen
top J join
lines K help L screen
bottom : ex cmd
line
h ⬅ j ⬇ k ⬆ l ➡
visual
lines B back
WORD N prev
(find) M screen
mid'l < un-
indent > indent ?·
visual
mode b back
word n next
(find) m· set
mark . repeat
cmd /·
special functions,
ll of them work in visual mode, or can be repeated > > , etc...) extra requires extra input
o operate on the current line.
toggles the case of the character under the cursor.
Now go grab the full cheat sheet and learn the rest.
Start with I a , and ; . Piece of cake!
- prev
line = auto
format
{ begin
parag } end
parag
[· misc ]· misc
ex cmd
line "· reg.
spec
'· goto
mk. bol
find
(rev.)
find
special functions,
requires extra input