Skip to content

Instantly share code, notes, and snippets.

@soardex
Created January 23, 2016 11:37
Show Gist options
  • Save soardex/338eaecb63dc256180da to your computer and use it in GitHub Desktop.
Save soardex/338eaecb63dc256180da to your computer and use it in GitHub Desktop.
My Vim Cheatsheet
# working with args
:args - list
:n - next
:prev - previous
:n [filename] - open new file
# working with tabs
:tabe [filename] - open new tab
:tabn - next
:tabp - previous
# working with buffers
:ls, :buffers, :files - list
:b#, :b [filename], :e ## - switch buffer
:e - open new file
# open quickfix window
:cl, :cn
# NerdTree Files Shortcuts
o: open in prev window
go: preview
t: open in new tab
T: open in new tab silently
i: open split
gi: preview split
s: open vsplit
gs: preview vsplit
# Tabular
:Tab /= - align
:Tab /=\zs - align excluding the =
# vim-surround
cs"' - change surround " to '
ds" - remove surround "
yss" - wrap entire line with "
ysiw" - wrap word with "
S" - (on visual mode) surround with "
# emmet-vim
<c-y>, - to trigger
# vim-easymotion
\\s - jump to target letter (entire document)
\\w - jump per word
\\f - jump to target letter (onwards of cursor)
# macros
q[letter bind][series of commands]q - record
[number of repeats]@[letter bind] - execute
:reg [letter bind] - view macro
q[letter bind uppercase][series of commands]q - to append to a macro
# others
. - just press to repeat last command
:map - view all key mappings
:unmap - unmap key
# key mapping help
:help :map
:help :map-modes
# mode specific maps
nmap, nnoremap, nunmap Normal mode
imap, inoremap, iunmap Insert and Replace mode
vmap, vnoremap, vunmap Visual and Select mode
xmap, xnoremap, xunmap Visual mode
smap, snoremap, sunmap Select mode
cmap, cnoremap, cunmap Command-line mode
omap, onoremap, ounmap Operator pending mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment