Skip to content

Instantly share code, notes, and snippets.

@blackrobot
Last active October 7, 2018 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blackrobot/eb034ad9d9e71775dd2f21c08a67e687 to your computer and use it in GitHub Desktop.
Save blackrobot/eb034ad9d9e71775dd2f21c08a67e687 to your computer and use it in GitHub Desktop.
A cheatsheet of plugin commands built into the VS Code Vim extension

VSCodeVim Cheatsheet

The <leader> key has been replaced with , from the original docs. The readme file this was pull from lives here:

https://github.com/VSCodeVim/Vim/blob/d114b946e963f0e47f372f27f334800a504aab87/README.md#vim-easymotion

Easy Motion

Motion Command Description
,, s <char> Search for char
,, f <char> Find character forwards
,, F <char> Find character backwards
,, t <char> Til character forwards
,, T <char> Til character backwards
,, w Start of word forwards
,, b Start of word backwards
,, l matches beginning & ending of word, camelCase, after _ and after # forwards
,, h matches beginning & ending of word, camelCase, after _ and after # backwards
,, e End of word forwards
,, ge End of word backwards
,, j Start of line forwards
,, k Start of line backwards
,, / <char>... return Search n-character
,,, bdt Til character
,,, bdw Start of word
,,, bde End of word
,,, bdjk Start of line
,,, j JumpToAnywhere motion; default behavior matches beginning & ending of word, camelCase, after _ and after #

Surround

Surround Command Description
d s <existing char> Delete existing surround
c s <existing char> <desired char> Change surround existing to desired
y s <motion> <desired char> Surround something with something using motion (as in "you surround")
S <desired char> Surround when in visual modes (surrounds full selection)

Indent Object

Based on vim-indent-object, it allows for treating blocks of code at the current indentation level as text objects. Useful in languages that don't use braces around statements (e.g. Python).

Provided there is a new line between the opening and closing braces / tag, it can be considered an agnostic cib/ci{/ci[/cit.

Command Description
<operator> ii This indentation level
<operator> ai This indentation level and the line above (think if statements in Python)
<operator> aI This indentation level, the line above, and the line after (think if statements in C/C++/Java/etc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment