This guy’s tutorials look pretty excellent:
- https://thevaluable.dev/vim-beginner/
- https://thevaluable.dev/vim-intermediate/
- https://thevaluable.dev/vim-advanced/
C-x {2,3}C-w s/:sp,C-w v/:vspC-x oC-w {h,j,k,l}C-x 1C-w o
C-x C-f:e <filename>C-x b:lsC-x 0:q
- Hit
vto toggle “visual mode” to start selecting text- While in Visual mode, you can hit
oto exchange point and mark
- While in Visual mode, you can hit
C-wd(works with visual mode turned on)M-wy(ditto; this is called “yank”)C-yp(“put”)
Replace this pattern with that string: :s/this pattern/that string/gc
The c flag on the end signals that vim should confirm replacements, much like query-replace in Emacs.
C-o- (While in insert mode) switch to normal mode for the next command.
xp- Simulates swapping a character, by first deleting it, then putting it back.
dawwP- Simulates swapping a word, by first deleting it, moving forward, then putting it behind the current character.
V- (shift-v) visual mode, but start by selecting the current line
C-v- visual-block mode, like
C-x C-SPC C-r- redo, but I need to customize my unto system first
f<char>- move to a character before your cursor; think avy-goto-char-1
F<char>- same, but backwards
t<char>- move to the char before the one specified; ditto with
T<char> <num>G- Goto line <num>
D- Same as
Ctrl-kin Emacs df(- Delete up to the next
( cf(- Ditto, but leave in insert mode (like the change commands)
zz- Like hitting
C-lto center a line z<RET>- Put current line at top
z-- Put current line at bottom
z.- Does something similar
gf- edit filename under cursor
gx- call
openon the file under cursor gi- go to last edit and set cursor to insert mode
g;- go to next change
g,- go to previous change
gi- I think this means “go to last edit and insert”
gt,gT- go forward, back tabs
q<letter>- start recording macro in register
<letter> q- stop recording
@<letter>- replay macro
s- split horizontally
v- split vertically
n- split horizontally and edit a new file
r- rotate windows
x- swap with next window
- ===
- resize all windows to be equal (like
C-x =in Emacs-mode) -,+- decrease, increase height
<,>- decrease, increase width
(,)- go to the beginning and end of a sentance
z=- run ispell-word
\\==- (two equal signs) indent current line
[<SPC>,]<SPC>- insert spaces above and below
yS<open delimiter><movement>- wrap the movement (e.g., for
wwrap a word,f.will wrap to the next period) in the delimiter with space padding yS<close delimiter><movement>- same as above, but don’t put spaces around the delimiters
Similar to From Normal Mode, but it doesn’t take a movement. Instead, just wraps whatever you’ve marked. This might be easier to use.