Skip to content

Instantly share code, notes, and snippets.

@jacobobryant
Last active November 18, 2019 16:01
Show Gist options
  • Save jacobobryant/5a493f116cc64b0c1fecd15bfb9ece70 to your computer and use it in GitHub Desktop.
Save jacobobryant/5a493f116cc64b0c1fecd15bfb9ece70 to your computer and use it in GitHub Desktop.
common vim commands
MOVEMENT
j k h l
b B w W
C-u C-d ("control-u")
gg G 10G
C-e C-f
%
0 $
C-o <tab>

SELECTION
v V C-v
C-v in combination with I (good for inserting comments at the beginning of each line)

EDITING
i I
a A
d<movement> (e.g. dw, dW, d%, dgg, dG, or just d after doing a selection)
dd
D
c<movement>
cc
C
y<movement>
yy
p P (also works after e.g. dd or cc, not just yy)
x
= (after a selection)
==

FIND
/<text you want to find>
n N (after /)

FIND & REPLACE
:s/foo/bar
:s/foo/bar/gc

SAVE + QUIT
:w
:wa
:q
:qa
:x
:xa

WINDOW MANAGEMENT
:sp
:vert sp
:q (close the current window)
C-wC-w
C-wC-h
C-wC-j
C-wC-k
C-wC-l
:tabnew
:tabc
gt
gT

MACROS
qa
q
@a
@@

REPL INTERACTION
,e (specific to my config)
cpp
K

STUFF SPECIFIC TO MY CONFIG FILE
mostly, just search for any lines with "map" in them (/map) and familiarize yourself with those.
e.g. `map <c-l> gt` means that C-l is the same as gt
For the plugins, you can also search for them on github and see the readmes
...but problably the only ones worth looking at are fireplace and vim-session
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment