Skip to main content

VSCode

Setup​

  • install extensions:
    • Remote-Containers
      • on Ubuntu: only Dev-Containers
    • C/C++
    • Doxygen Documentation Generator
    • CMake
    • CMake Tools
    • Python (for debugging)
    • Pylance
    • Jupyter
    • Jupyter Keymap
    • Jupyter Notebook Renderers
    • TabNine Autocompletion
    • vim
    • Markdown PDF
      • for md2pdf conversion
  • for Spring Boot in vscode:
  • set "Toggle Vim Mode" command keybinding "ctrl + alt + v" in menu "Manage" (unten links) → keyboard shortcuts → search "togglevim"

Reset​

  • if something does not work, e.g.
    • context menu is popping up automatically on vscode startup
  • stackoverflow instructions
    • settings:
      • Press F1
      • Type user settings
      • Press enter
      • Click the "sheet" icon to open the settings.json file
      • delete the file's contents and save
    • extensions:
      • delete ~/.vscode/extensions

Vim Mode​

commanddescription
ctrlaltvtoggle vim mode (this custom shortcut must have been configured previously)

Search Shortcuts​

commanddescription
ctrlk ctrlsall shortcuts

Tabs​

commanddescription
ctrlwclose current tab

Workspaces​

commanddescription
ctrlropen workspace ...

Open Files​

commanddescription
ctrle or ctrlpGo to file ...
ctrloopen file
ctrlnnew file

Git​

commanddescription
ctrlshiftgGit
"Timeline" view under the File ExplorerGit "Timeline" for a specific file (click on the "view commit" symbol on the right side of the commit to view all changes of all files in the commit)

View​

commanddescription
ctrl0focus file explorer
ctrl1focus editor group 1
ctrl2focus editor group 2, usw.
ctrlwclose current editor group (after all tabs in this group have been closed)
alt1focus first tab in current editor group
alt2focus second tab in current editor group, usw.
ctrljshow panel (problems, output, terminal, debug console)
ctrlöview: toggle terminal
ctrlshiftyview: toggle debug console
ctrlbshow side bar (file explorer)

Fold​

commanddescription
ctrlk ctrltchange theme
ctrlk ctrl0collapse all
ctrlk ctrl1collapse level 1
ctrlk ctrljunfold all

Jump​

commanddescription
ctrlshift.focus breadcrumbs (jump between methods/functions)
ctrlalt-go back (i.e. jump to previous location) (Windows: altleft)
ctrlshift-go forward (i.e. jump to next location) (Windows: altright)
ctrlk ctrld"move last selection to next find match" (like * in Vim)
ctrld"add selection to next find match" (for quickly modifying multiple occurrences of the selected code simultaneously)

Write​

commanddescription
ctrlhfind and replace (in the replace window press ctrlaltenter to replace all)
ctrlccopy line
shiftaltDowncopy line down
ctrlxcut line
ctrlshiftkdelete line
ctrllexpand line selection
altshiftrightexpand selection
ctrlk ctrlcadd line comment
ctrlk ctrluremove line comment
ctrlshiftiformat file (in command palette: "format document")
ctrlkctrlfformat selection
ctrlshiftup/downplace cursor on multiple lines
ctrlshiftup/down, ctrlxselect and cut multiple lines

Markdown​

commanddescription
ctrlshiftvtoggle preview/edit
ctrlk vside-by-side preview