Β
ESC
/Ctrl + [
- Normal Modea
- Insert Mode (After Current Char)i
- Insert Mode (Before Current Char)v
- Visual Mode / Selection ModeR
- Replace Mode:
- Command Mode
Β
h
- Left arrowl
- Right arrowj
- Down arrowk
- Up arrow
Β
/pattern
- Search forward?pattern
- Search backwardn
- Repeat search forwardN
- Repeat search backward
Β
πΉ Char (Inside Current Line)
fc
- Go forward to characterc
Fc
- Go backward to characterc
tc
- Go forward before characterc
Tc
- Go backward before characterc
;
- Go forward next,
- Go backward next
πΉ Word
e
- Last char before spacew
- Next word (first char)b
- Previous word (first char)ge
- Previous Word (last char)*
- Next same word#
- Previous same word
πΉ Current Line
0
- Start of the line^
- Start of the line (after whitespace)I
- Start of the line and insert (after whitespace)$
- End of the lineA
- End of the line and insert
πΉ Line
o
- Next line and insertO
- Previous line and insertgg
- First lineG
- Last line:n
- Goto n linenG
- Goto n line
πΉ Block / Paragraph
{
- Move up}
- Move down%
- Jump between braces ((
)
,{
}
,[
]
)
πΉ Window / Page
zz
- Center this linezt
- Top this linezb
- Bottom this lineH
- Top of screenM
- Middle of screenL
- Bottom of screenCtrl + u
- Page up (Half page)Ctrl + d
- Page down (Half page)
πΉ Tab
:tabclose
- Close current tab:tabfirst
- First tab:tablast
- Last tab:tabn
- Next tabtabp
- Previous tab
Β
ve
- Select until next spacevw
- Select until next word (Highlight word)V
- Select current linev
- Select current char (Highlight char)
Β
y
- Copy selected (Only in visual mode)yy
- Copy current lineyw
- Copy current wordyj
- Copy current and previous lineyk
- Copy current and next line
Β
πΉ Paste
p
- Paste nextP
- Paste Previous
πΉ Delete
x
- Delete current chars
- Delete current char and insertcw
- Delete all char before space and insert (from cursor)dw
- Delete until next worddiw
- Delete current wordX
- Delete current word and insert (Custombdwi
)dd
- Delete current lineS
- Delete current line and insertD
- Delete the rest of the lineC
- Delete the rest of the line and insert
πΉ Replace
r
- Replace one characterR
- Replace multiple character (Replace Mode)
πΉ Undo/Redo
u
- Undo changesCtrl + r
- Redo
:q
- Close file:q!
- Close file, abandon changes:qa
- Close all files:qa!
- Close all files, abandon changes:w
- Save changes:wq
/:x
- Save and close fileZZ
- Save and quitZQ
- Quit without checking changes
- All keys mentioned above can be combined with one another.
- Example:
ct)
can delete everything until)
. That means it can be used for clear function parameter or something like that. Herec
meanscut
andt)
means forward until char)
.
- Example:
di{
- Delete everything inside{}
d2i{
- Delete everything inside{}
and its surround{}
.ct}
- Delete everything until}
and insert.d5$
- Delete next 5 lines after cursor.0d5$
- Delete next 5 lines including current.cip
- Delete paragraph and insertdi(
- Delete everything inside()
yi(
- Copy everything inside()
vi(
- Highlight everything inside()
diw
- Delete current word
Β
Β
πΉ Disable Vim ctrl+c
ctrl+v
ctrl+x
commands
"vim.useCtrlKeys": true,
"vim.handleKeys": {
"<C-c>": false,
"<C-x>": false,
"<C-v>": false
}
Β
πΉ Disable Vim arrow controls
"vim.handleKeys": {
"<": false,
">": false
}
Β
πΉ Enable jj
to Normal Mode
"vim.insertModeKeyBindingsNonRecursive": [
{
"before": ["j", "j"],
"after": ["<esc>"]
}
]
Β
πΉ Enable X
to Delete Current Word and Insert
"vim.normalModeKeyBindings": [
{
"before": ["X"],
"after": ["b","d","w","i"]
}
]
Β
πΉ Enable vim to use System Clipboard
"vim.useSystemClipboard": true
Β
πΉ Fix buggy undo
redo
and make it like vscode
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["u"],
"after": [],
"commands": [
{
"command": "undo",
"args": []
}
]
},
{
"before": ["<C-r>"],
"after": [],
"commands": [
{
"command": "redo",
"args": []
}
]
}
]
Β
πΉ Enable move cursor to each wrapped line (if wrap line enable)
{
"before": ["j"],
"after": ["g", "j"]
},
{
"before": ["k"],
"after": ["g", "k"]
}