Skip to content

Instantly share code, notes, and snippets.

@dbowling
Last active July 28, 2022 23:56
Show Gist options
  • Save dbowling/924ac1746aabe7d9fd562afc264e4bb3 to your computer and use it in GitHub Desktop.
Save dbowling/924ac1746aabe7d9fd562afc264e4bb3 to your computer and use it in GitHub Desktop.
Keyboard Shortcuts

VSCode

Vim / VSCodeVim

  • . repeat last command
  • z undo
  • ctrl+r redo

Change / Replace

  • cw – Change from cursor to the end of the word
  • caw – Change around the word, including trailing whitespace
  • ciw – Change inside the word, excluding trailing whitespace
  • ci" - Change in Quote
  • cc - replace (change) line
  • +b - toggle boolean (requires Toggle Boolean extension)

Motions

  • 0 go to start and $ for end
  • o - enter Edit mode in a new line after the current line
  • word motions (w, e, b)

Other

  • g d - Go to Definition
  • << >> - Indent and outdent

Sneak

sab or Sab - Search to the right or left for ab ; - Next result

<leader> is \ in vscode.

\\f find {char} down \\F find {char} up

Default Mapping      | Details
---------------------|----------------------------------------------
<Leader>f{char}      | Find {char} to the right. See |f|.
<Leader>F{char}      | Find {char} to the left. See |F|.
<Leader>t{char}      | Till before the {char} to the right. See |t|.
<Leader>T{char}      | Till after the {char} to the left. See |T|.
<Leader>w            | Beginning of word forward. See |w|.
<Leader>W            | Beginning of WORD forward. See |W|.
<Leader>b            | Beginning of word backward. See |b|.
<Leader>B            | Beginning of WORD backward. See |B|.
<Leader>e            | End of word forward. See |e|.
<Leader>E            | End of WORD forward. See |E|.
<Leader>ge           | End of word backward. See |ge|.
<Leader>gE           | End of WORD backward. See |gE|.
<Leader>j            | Line downward. See |j|.
<Leader>k            | Line upward. See |k|.
<Leader>n            | Jump to latest "/" or "?" forward. See |n|.
<Leader>N            | Jump to latest "/" or "?" backward. See |N|.
<Leader>s            | Find(Search) {char} forward and backward.
                     | See |f| and |F|.

Also check out vim-surround

Vimium

Vi Omnibar

T search open tabs o search URL, bookmark and history (use O for new tab)

Navigation

gg scroll to top G scroll to bottom d scroll half page down u scroll half page up [[ or ]] next or previous link

Links

f overlays all links on screen, allowing you to type the letters to follow the link in the same tab F same as above, but new tab W open link in new window

Find

/ + search term + <enter> finds in the page n goes to next result N goes to previous result

Window

yy copy the URL of the current page to the clipboard ge edit URL

Tabs

x close tab X restore tab << move tab left >> move tab rigth

History

H go back l go forward

Misc

gs go to page source ? help

cVim (no longer used)

Navigation

gg scroll to top G scroll to bottom

Links

f overlays all links on screen, allowing you to type the letters to follow the link in the same tab F same as above, but new tab W open link in new window

Searching

/ + search term + <enter> finds in the page n goes to next result N goes to previous result

Window

yy copy the URL of the current page to the clipboard

Extension

GitHub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment