Workflow quotidien¶
Les raccourcis, commandes et fonctionnalités qui rendent productif au jour le jour dans VS Code.
Palette de commandes¶
Le point d'entree pour tout : Ctrl+Shift+P (ou Cmd+Shift+P sur macOS).
Préfixes utiles :
| Préfixe | Action |
|---|---|
| (vide) | Recherche de commandes |
> | Commandes (par defaut) |
@ | Symboles dans le fichier courant |
@: | Symboles groupes par catégorie |
# | Symboles dans tout le workspace |
: | Aller a une ligne |
Raccourcis essentiels¶
Navigation¶
| Action | Windows/Linux | macOS |
|---|---|---|
| Ouvrir un fichier | Ctrl+P | Cmd+P |
| Aller a une ligne | Ctrl+G | Cmd+G (1) |
| Aller a un symbole | Ctrl+Shift+O | Cmd+Shift+O |
| Définition | F12 | F12 |
| Références | Shift+F12 | Shift+F12 |
| Retour arriere | Alt+Left | Ctrl+- |
| Fichier suivant/précédent | Ctrl+Tab | Ctrl+Tab |
Edition multi-curseurs¶
| Action | Windows/Linux | macOS |
|---|---|---|
| Curseur supplémentaire | Alt + clic | Option + clic |
| Selectionner occurrence suivante | Ctrl+D | Cmd+D |
| Selectionner toutes les occurrences | Ctrl+Shift+L | Cmd+Shift+L |
| Curseurs en colonne | Ctrl+Alt+Up / Ctrl+Alt+Down | Cmd+Option+Up / Cmd+Option+Down |
Multi-curseurs en pratique
Placez-vous sur un mot, appuyez sur Ctrl+D plusieurs fois pour selectionner les occurrences suivantes, puis tapez le remplacement. Plus rapide qu'un Find & Replace pour les petits lots.
Manipulation de lignes¶
| Action | Windows/Linux | macOS |
|---|---|---|
| Déplacer une ligne | Alt+Up / Alt+Down | Option+Up / Option+Down |
| Dupliquer une ligne | Shift+Alt+Up / Shift+Alt+Down | Shift+Option+Up / Shift+Option+Down |
| Supprimer une ligne | Ctrl+Shift+K | Cmd+Shift+K |
| Commenter/decommenter | Ctrl+/ | Cmd+/ |
Terminal integre¶
Ouvrir : Ctrl+` (backtick)
Fonctionnalités utiles :
- Split terminal : icone de split ou Ctrl+Shift+5
- Renommer un terminal : clic droit sur l'onglet
- Liens cliquables : Ctrl + clic sur un chemin ou une URL dans la sortie
- Selection de shell : choisir entre bash, zsh, PowerShell via le dropdown
// Configurer le shell par defaut
{
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"zsh": { "path": "/bin/zsh" },
"bash": { "path": "/bin/bash" }
}
}
Snippets¶
Créer un snippet : Ctrl+Shift+P → "Snippets: Configure Snippets"
// .vscode/project.code-snippets
{
"Log variable": {
"scope": "javascript,typescript",
"prefix": "logv",
"body": ["console.log('${1:variable}:', ${1:variable});"],
"description": "Log a variable with its name"
},
"Python main guard": {
"scope": "python",
"prefix": "pymain",
"body": [
"def main():",
" ${1:pass}",
"",
"",
"if __name__ == \"__main__\":",
" main()"
]
}
}
Tasks¶
Automatiser les commandes recurrentes via .vscode/tasks.json :
{
"version": "2.0.0",
"tasks": [
{
"label": "lint",
"type": "shell",
"command": "npm run lint",
"group": "test",
"problemMatcher": ["$eslint-stylish"]
},
{
"label": "test",
"type": "shell",
"command": "pytest -v",
"group": {
"kind": "test",
"isDefault": true
}
}
]
}
Exécuter : Ctrl+Shift+P → "Tasks: Run Task" → choisir la tâche.
Recherche¶
| Action | Raccourci |
|---|---|
| Chercher dans le fichier | Ctrl+F |
| Chercher dans tout le projet | Ctrl+Shift+F |
| Chercher et remplacer | Ctrl+H |
| Chercher et remplacer dans le projet | Ctrl+Shift+H |
Filtres de recherche utiles :
files to include:src/**/*.ts(glob)files to exclude:**/node_modules- Activer le regex pour les patterns complexes