Skip to content

Instantly share code, notes, and snippets.

@dinkopehar
Last active November 17, 2018 11:19
Show Gist options
  • Save dinkopehar/66a3924a4b813e335b68a2ef4e7603f8 to your computer and use it in GitHub Desktop.
Save dinkopehar/66a3924a4b813e335b68a2ef4e7603f8 to your computer and use it in GitHub Desktop.
Some Vim commands that I learned through VSCode Vim extension and Extensions for VSCode

Vim commands to know AND EXTENSIONS FOR VSCODE.

Edit:

  • i and a for insert mode
  • I and A for insert to begin/end
  • o and O for insert new line below/above

Moving Commands

  • {n}G or :{n} for moving to specified line
  • 0 for moving to beginning of current line
  • $ for moving to end of current line
  • w for moving forward one word
  • b for moving backward one word
  • e for moving at end of words
  • % for moving to matching character (), {}, []
  • ^ for moving to first non-blank character on line
  • gg for moving to first line of document
  • G for moving to last line of document
  • Ctrl + e move screen down one line
  • Ctrl + y move screen up one line

Exit Commands

  • wq for write and exit
  • q for exit with warning
  • q! for exit without warning

Text Deletion Commands

  • x for deleting character forward
  • X for deleting character backward
  • dw for deleting word forward
  • db for deleting word backward
  • dd for deleting line
  • S or cc for delete line and substitute text
  • ciw change and replace word

Yank and paste commands

  • yy for yanking current line
  • y for yanking marked text
  • p for paste below current line
  • P for paste above current line

Working with files

  • Ctrl + ww switch window
  • Ctrl + wq close window

Search and replace

  • /pattern search for pattern
  • n next in search
  • N previous in search
  • :s%/old/new/g for replacing "old" with "new" globaly
  • :s%/old/new/gc for replacing "old" with "new" with confirmation

VS Code commands

  • F2 refactor
  • F12 goto definition
  • Alt + Up/Down move lines up/down

Misc

  • u Undo
  • Ctrl + r Redo
  • cw Change word
  • r Replace character at current position
  • R Replace or overstrike mode
  • v Visual mode
  • > Shift text right
  • < Shift text left

Extensions:

  • Python VS Code extension
  • Debugger for Chrome
  • One Dark Pro (Atom Theme) or Light+ (integrated)
  • Vim emulation
  • vs-code icons
  • ESLint
  • Bracket Pair Colorizer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment