Skip to content

Instantly share code, notes, and snippets.

@johanvanhelden
Last active March 3, 2022 10:36
Show Gist options
  • Save johanvanhelden/0f0e33948c582c6378a7421cfbe5b945 to your computer and use it in GitHub Desktop.
Save johanvanhelden/0f0e33948c582c6378a7421cfbe5b945 to your computer and use it in GitHub Desktop.
Personal VSCode settings
  • PHP Intelephense -> with premium license for better autocompletion and refactoring
  • Project Manager -> to allow for easy switching between projects
  • Better PHPUnit -> to easily execute tests
  • Eslint -> JS validation/linting
  • EditorConfig -> editorconfigfile support
  • Laravel Extra Intellisense -> Extra Laravel functionality
  • Laravel goto view
  • npm Intellisense
  • Partial diff
  • Path intellisense
  • php cs fixer (author: junstyle, has better configuration options)
  • PHP DocBlocker
  • PHP Mess Detector
  • phpcs (author: loannis kappas)
  • Stylelint -> CSS linting
  • Tailwind CSS Intellisense
  • Vetur -> Vue tooling
  • Yaml
  • PHPStan could be usefull but I don't like the lag.

For configuration, take a look at the settings.json in this Gist. Don't forget to change any paths containing USERNAME.

// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+alt+m",
"command": "better-phpunit.run"
},
{
"key": "meta+k meta+r",
"command": "-better-phpunit.run"
},
{
"key": "ctrl+alt+f",
"command": "better-phpunit.run-file"
},
{
"key": "meta+k meta+f",
"command": "-better-phpunit.run-file"
},
{
"key": "meta+k meta+p",
"command": "-better-phpunit.run-previous"
},
{
"key": "ctrl+shift+d",
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+alt+down",
"command": "-editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "shift+alt+up",
"command": "-editor.action.copyLinesUpAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "shift+alt+down",
"command": "-editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+alt+p",
"command": "better-pest.run"
},
{
"key": "win+k win+r",
"command": "-better-pest.run"
},
{
"key": "win+k win+p",
"command": "-better-pest.run-previous"
},
{
"key": "ctrl+shift+alt+p",
"command": "better-pest.run-file"
},
{
"key": "win+k win+f",
"command": "-better-pest.run-file"
}
]
{
"breadcrumbs.enabled": false,
//
"editor.acceptSuggestionOnEnter": "off",
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"editor.fontFamily": "'Jetbrains Mono Light', 'monospace', monospace, 'Droid Sans Fallback'",
"editor.fontLigatures": true,
"editor.formatOnSave": true,
"editor.minimap.size": "fit",
"editor.minimap.showSlider": "always",
"editor.multiCursorModifier": "ctrlCmd",
"editor.wordSeparators": "`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?",
"editor.suggest.showStatusBar": true,
"editor.suggest.insertMode": "insert",
"editor.inlineSuggest.enabled": true,
//
"extensions.ignoreRecommendations": false,
//
"files.defaultLanguage": "markdown",
//
"git.ignoreMissingGitWarning": true,
"git.enableCommitSigning": true,
"git.enableSmartCommit": true,
//
"oneDarkPro.editorTheme": "One Dark Pro",
"oneDarkPro.vivid": true,
//
"explorer.openEditors.visible": 0,
//
"javascript.updateImportsOnFileMove.enabled": "always",
//
"php.suggest.basic": false,
//
"security.workspace.trust.untrustedFiles": "open",
//
"search.exclude": {
"**/bower_components": true,
"**/dist": true,
"**/node_modules": true,
"**/storage": true,
"vendor": true,
"public_html/vendor": true
},
"search.showLineNumbers": true,
"search.smartCase": true,
//
"scss.validate": false,
"css.validate": false,
"less.validate": false,
//
"telemetry.telemetryLevel": "off",
//
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.cursorStyle": "line",
"terminal.integrated.tabs.enabled": true,
"terminal.integrated.scrollback": 10000,
//
"workbench.colorCustomizations": {},
"workbench.colorTheme": "One Dark Pro",
"workbench.iconTheme": "material-icon-theme",
"workbench.editor.enablePreviewFromCodeNavigation": true,
"workbench.editorAssociations": {
"*.ipynb": "jupyter.notebook.ipynb"
},
//
// LANGUAGE SETTINGS
//
"[php]": {
"editor.defaultFormatter": "junstyle.php-cs-fixer"
},
// turn it off for JS and JSX, we will do this via eslint
"[javascript]": {
"editor.formatOnSave": false
},
"[javascriptreact]": {
"editor.formatOnSave": false
},
//
// EXTENSION SETTINGS
//
"better-phpunit.docker.enable": false,
"better-phpunit.docker.command": "docker exec --user=dockerhero -it -w /var/www/projects/${workspaceFolderBasename} dockerhero_workspace",
"better-phpunit.docker.paths": {
"/home/USERNAME/projects": "/var/www/projects/"
},
//
"eslint.alwaysShowStatus": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"vue"
],
"eslint.workingDirectories": [
//
],
//
"intelephense.telemetry.enabled": false,
//
"LaravelExtraIntellisense.modelsPaths": [
"app",
"app/Models"
],
//
"material-icon-theme.activeIconPack": "vue",
//
"partialDiff.enableTelemetry": false,
//
"phpcs.standard": "phpcs.xml",
"phpcs.executablePath": "/home/USERNAME/.composer/vendor/bin/phpcs",
"phpmd.rules": "phpmd.xml",
//
"php-cs-fixer.executablePath": "/home/USERNAME/.composer/vendor/bin/php-cs-fixer",
"php-cs-fixer.onsave": true,
"php-cs-fixer.rules": "@PSR2",
"php-cs-fixer.config": ".php-cs-fixer.php;.php_cs;/home/USERNAME/projects/tools/configfiles/php/.php-cs-fixer.php",
"php-cs-fixer.allowRisky": true,
"php-cs-fixer.lastDownload": 1634731660393,
//
"php-docblocker.useShortNames": true,
"php-docblocker.returnGap": true,
//
"projectManager.groupList": true,
"projectManager.openInNewWindowWhenClickingInStatusBar": true,
//
"redhat.telemetry.enabled": false,
//
"tailwindCSS.lint.cssConflict": "ignore",
//
"vetur.experimental.templateInterpolationService": true,
"vetur.format.enable": false,
"vetur.format.defaultFormatter.css": "none",
"vetur.format.defaultFormatter.html": "none",
"vetur.format.defaultFormatter.js": "none",
"vetur.format.defaultFormatter.less": "none",
"vetur.format.defaultFormatter.postcss": "none",
"vetur.format.defaultFormatter.pug": "none",
"vetur.format.defaultFormatter.sass": "none",
"vetur.format.defaultFormatter.scss": "none",
"vetur.format.defaultFormatter.stylus": "none",
"vetur.format.defaultFormatter.ts": "none",
"vetur.format.options.tabSize": 4,
"vetur.validation.templateProps": true,
"vetur.ignoreProjectWarning": true,
"vetur.useWorkspaceDependencies": true,
//
// OTHER SETTINGS
//
"launch": {
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9005,
"pathMappings": {
"/var/www/projects/${workspaceFolderBasename}": "${workspaceFolder}"
},
"ignore": [
"**/vendor/**/*.php"
]
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment