Some Notes on VSCode
VSCode is probably the most used editor today by web developers. It was created and is maintained by Microsoft. It benefits from a rich ecosystem of extensions for (almost) all languages and (almost) all programming languages.
It is free and largely open-source (to have a fully open-source build, without Microsoft's trackers, you need to use VSCodium).
The Interface
You need to recognize:
- the title bar
- the menu bar (with dropdown menus)
- the side bar (can be shown/hidden with the shortcut
Ctrl b
on PC andCmd b
on macOS) - the activity bar (the content of the side bar depends on what is activated in the activity bar)
- the status bar (with a lot of information, at the bottom)
- the panel (with several tabs, including the terminal and problems)
- the minimap (we will see next time)
- the ruler (we will see next time)
- the editor groups (we will see next time)
Some Important Shortcuts
Universal Shortcuts
Most universal shortcuts are available in VSCode:
Ctrl c
(orCmd c
for macOS) to copy (no need to select if you want the whole line)Ctrl x
(orCmd x
for macOS) to cut (no need to select if you want the whole line)Ctrl v
(orCmd v
for macOS) to pasteCtrl ,
(orCmd ,
for macOS) to go to settingsCtrl w
(orCmd w
for macOS) to close a tabShift Ctrl T
(orShift Cmd T
for macOS) to reopen the last closed tab
and others.
More Specific Shortcuts
Ctrl p
(orCmd p
for macOS) allows access to a fuzzy search of all files indexed by the current instance of VSCode. It is highly recommended to open a folder with VSCodeShift Ctrl p
(orShift Cmd p
for macOS) allows access to the command palette: all commands of VSCode and all installed extensions are available, also in fuzzy searchCtrl k, Ctrl o
(orCmd k, Cmd o
for macOS) to open a folder in the current instance of VSCodeShift Ctrl e
(orShift Cmd e
for macOS) allows access to the file explorerShift Ctrl f
(orShift Cmd f
for macOS) allows access to text search in all files indexed by the current instanceShift Ctrl d
(orShift Cmd d
for macOS) allows access to the runner and debuggerShift Ctrl g
(orShift Cmd g
for macOS) allows access to the version control manager (for us, Git, but VSCode also recognizes Mercurial and other VCS)Shift Ctrl x
(orShift Cmd x
for macOS) allows access to extensions
Extensions
Later, we will use:
Recommended Settings
jsonc
{
// (...)
"editor.bracketPairColorization.enabled": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"editor.codeLens": true,
"editor.fontFamily": "'JetBrains Mono', Consolas, 'Courier New', monospace", // Only if you download the JetBrains Mono font
"editor.fontLigatures": true,
"editor.guides.bracketPairs": "active",
"editor.linkedEditing": true,
"editor.rulers": [
120,
140
],
"[git-commit]": {
"editor.rulers": [
72,
100
],
"workbench.editor.restoreViewState": false
},
"editor.stickyScroll.enabled": false,
"editor.tabSize": 2,
"emmet.includeLanguages": {
"vue-html": "html"
},
"emmet.syntaxProfiles": {
"html": {
"inline_break": 2
},
"postcss": "css"
},
"emmet.variables": {
"lang": "fr"
},
"eslint.format.enable": true,
"eslint.validate": [
"javascript",
"typescript",
"vue"
],
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
"terminal.integrated.fontFamily": "'JetBrains Mono', Consolas, 'Courier New', monospace" // Only if you download the JetBrains Mono font
// (...)
}
Font to install on your OS (recommended)
Click on "Download font", open zip, find the folder fonts/variable
, double-click on the file named JetBrainsMono[wght].ttf
and click on the "Install" button. Close all instances (windows) of VSCode and launch again VSCode.