I’m doing it. I’m ready to try.
Reading
BOOST YOUR CODING FU WITH VISUAL STUDIO CODE AND VIM
In your terminal, you can type vimtutor
, opening a really useful program that helps you learn vim through practice 😊
VSCode Notes
The biggest threat to me not learning VIM bindings is probably that VSCode, terrifyingly, won’t immediately disable VIM unless I restart VScode. I can click “disable” on the plugin, but it will persist.
My workaround is, open the command pallete and run “Reload Window
”. This restarts the extension. It turns out this is a good workaround for other plugins that also don’t play nice with agreeing to being disabled, like copilot.
Modes
i
and some other stuff (a
?) takes you into insert mode
ESCand
CTRL-C` go back to normal mode
Commands
HJKL
keys to move as well as arrow keys
X
deletes char before cursor
x
deletes char AT cursor
dd
deletes a whole line
DD
deletes from the cursor to the end of the line, inclusive
U
undoes actions
:set number
adds line numbers
:2
takes you to line 2
w
next word
b
last word
e
end of word
ge
end of word backwards
Consider special chars like .({
, to be part of a word with the capitalized version of these word commands. WBEgE
f{char}
(find) takes you to the next occurrence of a character ON THAT LINE
Once you’ve done this
;
goes to the next
,
goes to the last
t{char
does the same, but it will take you to the char just before
0
first character of a line
^
first nonblank character of a line
$
moves to the end of a line
g_
moves to the non-blank character at the end of a line (this is bit less janky I think)
}
jumps a paragraph down
{
paragraph up
]]
goes to the bottom of page
[[
goes to the top of the page
CTRL-D
goes down half a page
CTRL-U
goes up half a page
/{pattern}
search forward
?{pattern}
search backwards
ENTER
goes to the first match in the search
It seems this match is saved, and after this you can use n
to go to the next match and N
to go to the last match
123G
goes to line 123