Skip to content

Instantly share code, notes, and snippets.

@ospatil
Last active February 13, 2024 12:46
Show Gist options
  • Save ospatil/c39324e6399f48c22637e1d6d8b5f484 to your computer and use it in GitHub Desktop.
Save ospatil/c39324e6399f48c22637e1d6d8b5f484 to your computer and use it in GitHub Desktop.
Essential shortcuts
VS Code
Jump to file explorer cmd + shift + e
Open highlighted file in file explorer cmd + down-arrow
Go back to editor cmd + 1
Toggle between terminal and editor ctrl + backtick
Open global search view cmd + shift + f
Fold all cmd + k + 0
Unfold all cmd + k + j
Unfold current option + cmd + [
Fold current option + cmd + ]
Terminal - move to previous Cmd+Shift+]
Terminal - move to next Cmd+Shift+[
Terminal - Focus tabs view Cmd+Shift+\
Bash
Go to beginning of command ctrl + a
Go to end of command ctrl + e
Go forward/back one word option + right-arrow and option + left-arrow
Delete from cursor to end of line ctrl + k
Delete from cursor to beginning of line ctrl + u
Command history search ctrl + r (use esc to exit without selecting a command)
Comment out the current command esc + #
Vim page navigation and search (VS Code extension)
Go to the top of document gg
Go to the bottom of document shift + g i.e. G
Move back one full screen ctrl + b
Move forward one full screen ctrl + f
Move back 1/2 screen ctrl + u
Move forward 1/2 screen ctrl + d
Go to line number :line_number + enter
search text / + text to search + enter then n to move forward and N to move back
easymotion forward by word \\ + w
easymotion backword by word \\ + b
easymotion search and highlight words starting with a letter \\ + f + letter
Change word under cursor ciw of ciW if word has slashes or dots (use diw to delete)
Delete text in delimiters (quotes, brackets etc.) di" or da" to delete including delimiter. Replace " with type of delimiter.
Delete text from cursor to next/previous space Next: dt+space including space: df+space, Previous: dfT+space
Delete all content of a file ggdG or :%d
Delete some lines in a file :<LINE>,<LINE>d ex: to delete lines from 9 to 13 :9,13d
Swap lines dd<number>jp to move current line +1 lines down and dd<number>kp to move up
Indent lines [number] + >> or << to indent number of lines
Undo and redo u for undo and ctrl + r for redo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment