Skip to content

Instantly share code, notes, and snippets.

@HusseinLezzaik
Last active August 7, 2023 14:42
Show Gist options
  • Save HusseinLezzaik/0280971bd9f374d32f77a3782a585cf6 to your computer and use it in GitHub Desktop.
Save HusseinLezzaik/0280971bd9f374d32f77a3782a585cf6 to your computer and use it in GitHub Desktop.
VSCode keyboard tips and tricks :)

Shortcuts

  • Create Snippets for repetitive code, or use available extensions
  • Create directories from VSCode GUI
  • If you want to rename something, right click and select “Find All References” and then use “Rename Symbol” option
  • Command Palette gives you all the power of the keyboard without having to memorize them
    $ CTRL + P // opens command palette, by default search for scripts to open
    $ CTRL + P + “>” // access to open any command in vscode along with commands from extensions ex toggle mini map
    $ CTRL + P + “@“ // symbols search; for whole codebase use #TargetSymbol or #TSA for T…S..A…
    $ CTRL + SHIFT + “.” // symbols search inside file itself
    $ CTRL + G + “:NN” // Go to line NN; use “⬅️” or “➡️“ for character by character, or “CTRL + arrows” for word by word
    $ CTRL + D // Find match, if you press D 5 times you can edit 5 occurrences at same time
    $ ALT + CLICK // Set multiple cursors
    $ ALT + SHIFT + ↕️ // Move highlighted line
    $ CTRL + L // Highlight lines
    $ CTRL + “/“ // Toggle comments; anything that starts with “!” Is red, “TODO” is in orange
    $ CTRL + "`" // open terminal; you can change name or color when you right click
    $ CTRL + ➡️/⬅️ // move between words in terminal command
    $ CTRL + K // clear terminal
    $ ps aux | grep "vscode-server" | grep -v grep | awk * {print $2} * | xargs kill -9 // kill vscode server $ CTRL + SHIFT + D // launches debugger $ Option + Right/Left // Toggle word by word on MacOS $ Ctrl + Right/Left // Toggle by word on Windows/Linux

Debugger

  1. Conditional breakpoints
  2. Logs
  3. Breakpoints

Extensions

  1. Git Graph
  2. Git Lens
  3. Copilot
  4. Auto-rename Tag
  5. Better comments
  6. CMake
  7. CMake Tools
  8. CTags Support
  9. Docker
  10. Git History
  11. gitignore
  12. Jupyter
  13. PyTorch Snippets
  14. Rainbow CSV
  15. Relative Path
  16. Remote SSH
  17. Tensorflow 2.0 Snippets
  18. VSCode-icons
  19. VSCode-pdf
  20. XML Tools
  21. Grammarly
  22. Github Copilot Labs
  23. VSCode-Numpy-Viewer
  24. Snippets
  25. Remote Repositories Extension // open GitHub repos and manage them from viscose for pull requests, code review, etc
  26. Fira Code

gdb

Breakpoints

$ p $ p type $ b <function_name> $ b arrays/two_pointers.c:15 $ info b // info about breakpoints $ enable <breakpoint_nb> $ disable <breakpoint_nb> $ delete <breakpoint_nb> $ clear // delete all breakpoints $ i b // lists all break points $ d

Watchpoints

$ watch «where> // set new watchpoint $ delete/enable/disable <watchpoint_nb>

Navigation

$ c // continue to next breakpoint $ c <n_iterations> // continue to the Nth iteration in for-loop $ s // step inside function $ n // next line $ l // list where we are first time, then moves $ frame $ h // help $ w // where are we $ q // quit $ bt // back trace $ finish // execute current function until it returns $ up // takes you to the function that's calling it

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