Table of contents
- Create config file
- Tips and Tricks
- Ignore files in search
- Exclude files from explorer
- Theme per project
- Favorite files and directories
- Run php artisan commands as tasks
- Configuration examples
- Laravel
Create config file
Create a file named settings.json in .vscode directory and add custom configuration:
mkdir .vscode
touch .vscode/settings.json
Tips and Tricks
Ignore files in search
⚠️ Important: files already open on the editor will not be ignored even if excluded in the settings.
{
"search.exclude": {
"**/node_modules": true,
"**/src/assets": true,
"**/public": true,
"package-lock.json": true,
"CHANGELOG.md": true,
"README.md": true,
}
}
Exclude files from explorer
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"_original_template": true,
"nbproject": true
},
Theme per project
{
"php.version": "v8.2.0",
"search.exclude": {
...
},
"workbench.colorTheme": "Default Dark Modern",
"workbench.colorCustomizations": {
"editor.background": "#001C40"
}
}
Favorite files and directories
Install the favorites plugin
Then you can define favorite files:
{
...
"favorites.resources": [
{
"filePath": "routes/api.php",
"group": "Default"
}
]
}
Run php artisan commands as tasks
Create a task (tasks.json) and press ctrl+shift+P to launch it.
{
"version": "2.0.0",
"tasks": [
{
"label": "php artisan serve",
"type": "shell",
"command": "php artisan serve",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": [],
"isBackground": true
},
{
"label": "php artisan test",
"type": "shell",
"command": "php artisan test",
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "shared"
}
}
]
}
Configuration examples
Laravel
{
"php.version": "v8.2.0",
"search.exclude": {
"**/bootstrap": true,
"**/vendor": true,
"**/node_modules": true,
"**/storage": true,
"**/src/assets": true,
"**/public": true,
"package-lock.json": true,
"CHANGELOG.md": true,
"README.md": true,
},
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"_original_template": true,
"node_modules": true,
"vendor": true,
"nbproject": true
},
"workbench.colorTheme": "Default Dark Modern"
}
You must be logged in to post a comment.