Skip to content

Instantly share code, notes, and snippets.

@mkuchak
Last active March 13, 2024 00:22
Show Gist options
  • Save mkuchak/40089067a2734293088115971d8af107 to your computer and use it in GitHub Desktop.
Save mkuchak/40089067a2734293088115971d8af107 to your computer and use it in GitHub Desktop.
The best VSCode setup ever
/*
* Ctrl+Shift+P > shortcuts
* Preferences: Open Keyboard Shortcuts (JSON)
*/
[
// Move the cursor and select between CamelCase words
{
"key": "alt+right",
"command": "cursorWordPartRight",
"when": "editorTextFocus"
},
{
"key": "alt+left",
"command": "cursorWordPartLeft",
"when": "editorTextFocus"
},
{
"key": "alt+shift+right",
"command": "cursorWordPartRightSelect",
"when": "editorTextFocus"
},
{
"key": "alt+shift+left",
"command": "cursorWordPartLeftSelect",
"when": "editorTextFocus"
},
// Delete the rest of the word forward or backward
{
"key": "alt+delete",
"command": "deleteWordRight",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "alt+backspace",
"command": "deleteWordLeft",
"when": "textInputFocus && !editorReadonly"
},
// Reverse the order of the lines
{
"key": "ctrl+shift+up",
"command": "editor.action.moveLinesUpAction",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+down",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus"
},
// Search for sentences equal to the current selection
{
"key": "ctrl+shift+d",
"command": "editor.action.addSelectionToNextFindMatch",
"when": "editorFocus"
},
// Duplicate current line with just one shortcut
{
"key": "ctrl+d",
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+d",
"command": "-editor.action.addSelectionToNextFindMatch",
"when": "editorFocus"
},
{
"key": "shift+alt+up",
"command": "-editor.action.copyLinesUpAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "shift+alt+down",
"command": "-editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
// Change the programming language of the current file
{
"key": "ctrl+j",
"command": "workbench.action.editor.changeLanguageMode",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "ctrl+j",
"command": "-workbench.action.togglePanel"
},
// Select up and down, vertically
{
"key": "ctrl+alt+down",
"command": "cursorColumnSelectDown",
"when": "textInputFocus"
},
{
"key": "ctrl+alt+up",
"command": "cursorColumnSelectUp",
"when": "textInputFocus"
},
// Create a block comment in the selected part like /* some selected part */
{
"key": "ctrl+shift+/",
"command": "editor.action.blockComment",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+;",
"command": "editor.action.blockComment",
"when": "editorTextFocus && !editorReadonly"
},
// Comment on selected lines
{
"key": "ctrl+/",
"command": "editor.action.commentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+;",
"command": "editor.action.commentLine",
"when": "editorTextFocus && !editorReadonly"
},
// Delete the line without copying to the clipboard
{
"key": "ctrl+shift+x",
"command": "editor.action.deleteLines",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "ctrl+shift+k",
"command": "-editor.action.deleteLines",
"when": "textInputFocus && !editorReadonly"
},
// Move the current tab to the right or to the left
{
"key": "ctrl+alt+right",
"command": "workbench.action.moveEditorRightInGroup",
"when": "editorTextFocus"
},
{
"key": "alt+right",
"command": "-workbench.action.terminal.focusNextPane",
"when": "terminalFocus"
},
{
"key": "ctrl+alt+left",
"command": "workbench.action.moveEditorLeftInGroup",
"when": "editorTextFocus"
},
{
"key": "alt+left",
"command": "-workbench.action.terminal.focusPreviousPane",
"when": "terminalFocus"
},
// Move the tab to a different screen split, whether left, right, up, or down
{
"key": "ctrl+shift+alt+up",
"command": "workbench.action.moveEditorToAboveGroup",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+alt+down",
"command": "workbench.action.moveEditorToBelowGroup",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+alt+left",
"command": "workbench.action.moveEditorToLeftGroup",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+alt+right",
"command": "workbench.action.moveEditorToRightGroup",
"when": "editorTextFocus"
},
// Create a new file (install patbenatar.advanced-new-file extension)
{
"key": "ctrl+n",
"command": "extension.advancedNewFile"
},
{
"key": "ctrl+alt+n",
"command": "-extension.advancedNewFile"
},
{
"key": "ctrl+n",
"command": "-workbench.action.files.newUntitledFile"
},
// Create a new empty tab
{
"key": "ctrl+t",
"command": "workbench.action.files.newUntitledFile"
},
{
"key": "ctrl+t",
"command": "-workbench.action.showAllSymbols"
},
// Go to the previous or next tab (similar to browsers)
{
"key": "ctrl+tab",
"command": "workbench.action.nextEditor"
},
{
"key": "ctrl+shift+tab",
"command": "workbench.action.previousEditor"
},
// Switch between tabs (similar to using Alt+Tab in Windows)
{
"key": "alt+q",
"command": "workbench.action.quickOpenPreviousRecentlyUsedEditor"
},
{
"key": "alt+q",
"command": "workbench.action.quickOpenNavigateNextInEditorPicker",
"when": "inEditorsPicker && inQuickOpen"
},
{
"key": "alt+shift+q",
"command": "workbench.action.quickOpenLeastRecentlyUsedEditor"
},
{
"key": "alt+shift+q",
"command": "workbench.action.quickOpenNavigatePreviousInEditorPicker",
"when": "inEditorsPicker && inQuickOpen"
},
// Toggle to hide and show the left and bottom sidebar
{
"key": "shift+alt+b",
"command": "workbench.action.toggleStatusbarVisibility"
},
{
"key": "ctrl+shift+b",
"command": "workbench.action.toggleActivityBarVisibility"
},
{
"key": "ctrl+shift+b",
"command": "-workbench.action.tasks.build"
},
{
"key": "ctrl+alt+b",
"command": "workbench.action.tasks.build"
},
// Open, hide, minimize and maximize the terminal
{
"key": "ctrl+shift+enter",
"command": "workbench.action.toggleMaximizedPanel"
},
{
"key": "shift+enter",
"command": "workbench.action.terminal.toggleTerminal"
},
{
"key": "shift+enter",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
{
"key": "ctrl+enter",
"command": "workbench.action.togglePanel"
},
{
"key": "ctrl+enter",
"command": "-github.copilot.generate",
"when": "editorTextFocus"
},
// Close terminal if selected
{
"key": "ctrl+shift+d",
"command": "workbench.action.terminal.split",
"when": "terminalFocus"
},
{
"key": "ctrl+shift+d",
"command": "-workbench.view.debug"
},
// Move the terminal left, down and right
{
"key": "ctrl+alt+d",
"command": "workbench.action.positionPanelRight"
},
{
"key": "ctrl+alt+s",
"command": "workbench.action.positionPanelBottom"
},
{
"key": "ctrl+alt+a",
"command": "workbench.action.positionPanelLeft"
},
// Open a recent Workspace
{
"key": "ctrl+shift+o",
"command": "workbench.action.openRecent"
},
{
"key": "ctrl+shift+o",
"command": "-workbench.action.gotoSymbol"
},
{
"key": "ctrl+r",
"command": "-workbench.action.openRecent"
},
// Trigger GitHub Copilot suggestions
{
"key": "ctrl+shift+c",
"command": "github.copilot.generate",
"when": "editorTextFocus"
},
// Write documentation for the selected function or class
{
"key": "ctrl+alt+oem_period",
"command": "docs.write",
"when": "editorTextFocus && config.docwriter.hotkey.windows == 'Ctrl + .' && editorLangId =~ /typescript|javascript|python|php|java|c|cpp|csharp|dart|ruby|go|rust/"
},
{
"key": "ctrl+oem_period",
"command": "-docs.write",
"when": "editorTextFocus && config.docwriter.hotkey.windows == 'Ctrl + .' && editorLangId =~ /typescript|javascript|python|php|java|c|cpp|csharp|dart|ruby|go|rust/"
},
// Toggle the match case when performing a search
{
"key": "alt+c",
"command": "toggleFindCaseSensitive",
"when": "editorTextFocus"
},
{
"key": "alt+c c",
"command": "-extension.colorHelper.convert",
"when": "editorTextFocus"
},
{
"key": "alt+c p",
"command": "-extension.colorHelper.pick",
"when": "editorTextFocus"
},
//Compresses folder expansion
{
"key": "alt+shift+e",
"command": "workbench.files.action.collapseExplorerFolders"
},
// Reveal file explorer
{
"key": "ctrl+shift+e",
"command": "remote-wsl.revealInExplorer",
"when": "editorTextFocus && remoteName == 'wsl'"
},
// Switch between the file explorer and the file picker
{
"key": "alt+e",
"command": "workbench.view.explorer",
"when": "viewContainer.workbench.view.explorer.enabled"
},
{
"key": "alt+e",
"command": "workbench.action.quickOpenNavigatePreviousInFilePicker",
"when": "inFilesPicker && inQuickOpen"
},
{
"key": "ctrl+shift+e",
"command": "-workbench.view.explorer",
"when": "viewContainer.workbench.view.explorer.enabled"
},
{
"key": "ctrl+shift+e",
"command": "-workbench.action.quickOpenNavigatePreviousInFilePicker",
"when": "inFilesPicker && inQuickOpen"
},
// Restart TypeScript and ESLint server (install ryuta46.multi-command extension)
{
"key": "ctrl+shift+r",
"command": "extension.multiCommand.execute",
"interval": 100,
"args": {
"sequence": ["typescript.restartTsServer", "eslint.restart"]
},
"when": "editorTextFocus && !editorReadonly && !inCompositeEditor"
},
// Format the file with the standard formatter (Prettier, for example) and then with ESLint
{
"key": "shift+alt+f",
"command": "extension.multiCommand.execute",
"interval": 100,
"args": {
"sequence": ["editor.action.formatDocument", "eslint.executeAutofix"]
},
"when": "editorTextFocus && !editorReadonly && !inCompositeEditor"
},
// Format file with ESLint
// {
// "key": "shift+alt+d",
// "command": "eslint.executeAutofix",
// "when": "editorTextFocus && !editorReadonly && !inCompositeEditor"
// },
// Format file with standard formatter
// {
// "key": "shift+alt+f",
// "command": "editor.action.formatDocument",
// "when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor"
// },
// Add required imports
{
"key": "shift+alt+a",
"command": "editor.action.sourceAction",
"args": {
"kind": "source.addMissingImports",
"apply": "first"
}
},
// Remove unnecessary imports and organize them
{
"key": "shift+alt+s",
"command": "extension.multiCommand.execute",
"interval": 10,
"args": {
"sequence": [
"typescript.removeUnusedImports",
"editor.action.organizeImports",
"typescript.organizeImports",
"typescript.sortImports"
]
},
"when": "editorTextFocus && !editorReadonly && !inCompositeEditor"
},
// Toggle to display function parameter names (install DominicVonk.parameter-hints extension)
{
"key": "alt+shift+p",
"command": "parameterHints.toggle"
},
// Break HTML tag into multiple lines (install dannyconnell.split-html-attributes extension)
{
"key": "shift+alt+x",
"command": "extension.splitHTMLAttributes",
"when": "editorTextFocus && !editorReadonly && !inCompositeEditor"
},
// Add or remove selected lines to the Git staging area
{
"key": "shift+alt+a",
"command": "git.stageSelectedRanges",
"when": "isInDiffEditor"
},
{
"key": "shift+alt+s",
"command": "git.unstageSelectedRanges",
"when": "isInDiffEditor"
},
// Toggle between continuous lines or line breaks at the limit of horizontal scrolling
{
"key": "shift+alt+z",
"command": "editor.action.toggleWordWrap",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "alt+z",
"command": "-editor.action.toggleWordWrap",
"when": "editorTextFocus && !editorReadonly"
},
// Attach a new remote container to VSCode
{
"key": "alt+a",
"command": "remote-containers.attachToRunningContainer"
},
// Expand or collapse block of code where the cursor is located
{
"key": "ctrl+shift+]",
"command": "editor.fold",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "ctrl+shift+\\",
"command": "editor.unfold",
"when": "editorTextFocus && foldingEnabled"
},
// Save file without formatting
{
"key": "ctrl+shift+s",
"command": "workbench.action.files.saveWithoutFormatting"
},
{
"key": "ctrl+shift+s",
"command": "-workbench.action.files.saveAs"
},
// Remove Markdown extension incompatibility with GitHub Copilot if installed
{
"key": "tab",
"command": "-markdown.extension.onTabKey",
"when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !suggestWidgetVisible && editorLangId == 'markdown'"
},
// Disable default Alt+Number commands
{
"key": "alt+1",
"command": "-workbench.action.openEditorAtIndex1"
},
{
"key": "alt+2",
"command": "-workbench.action.openEditorAtIndex2"
},
{
"key": "alt+3",
"command": "-workbench.action.openEditorAtIndex3"
},
{
"key": "alt+4",
"command": "-workbench.action.openEditorAtIndex4"
},
{
"key": "alt+5",
"command": "-workbench.action.openEditorAtIndex5"
},
{
"key": "alt+6",
"command": "-workbench.action.openEditorAtIndex6"
},
{
"key": "alt+7",
"command": "-workbench.action.openEditorAtIndex7"
},
{
"key": "alt+8",
"command": "-workbench.action.openEditorAtIndex8"
},
{
"key": "alt+9",
"command": "-workbench.action.openEditorAtIndex9"
},
// Customize Alt+Number commands and apply toggle for them
{
"key": "alt+1",
"command": "workbench.view.explorer"
},
{
"key": "alt+1",
"command": "workbench.action.toggleSidebarVisibility",
"when": "activeViewlet == 'workbench.view.explorer'"
},
{
"key": "alt+2",
"command": "workbench.view.scm"
},
{
"key": "alt+2",
"command": "workbench.action.toggleSidebarVisibility",
"when": "activeViewlet == 'workbench.view.scm'"
},
{
"key": "alt+3",
"command": "workbench.view.extensions"
},
{
"key": "alt+3",
"command": "workbench.action.toggleSidebarVisibility",
"when": "activeViewlet == 'workbench.view.extensions'"
},
{
"key": "alt+4",
"command": "workbench.view.search"
},
{
"key": "alt+4",
"command": "workbench.action.toggleSidebarVisibility",
"when": "activeViewlet == 'workbench.view.search'"
},
{
"key": "alt+5",
"command": "workbench.view.extension.rubberduck"
},
{
"key": "alt+5",
"command": "workbench.action.toggleSidebarVisibility",
"when": "activeViewlet == 'workbench.view.extension.rubberduck'"
},
{
"key": "alt+6",
"command": "workbench.view.debug"
},
{
"key": "alt+6",
"command": "workbench.action.toggleSidebarVisibility",
"when": "activeViewlet == 'workbench.view.debug'"
},
{
"key": "alt+7",
"command": "workbench.view.extension.dockerView"
},
{
"key": "alt+7",
"command": "workbench.action.toggleSidebarVisibility",
"when": "activeViewlet == 'workbench.view.extension.dockerView'"
},
{
"key": "alt+8",
"command": "workbench.view.remote"
},
{
"key": "alt+8",
"command": "workbench.action.toggleSidebarVisibility",
"when": "activeViewlet == 'workbench.view.remote'"
},
{
"key": "alt+9",
"command": "workbench.view.extension.gitlens"
},
{
"key": "alt+9",
"command": "workbench.action.toggleSidebarVisibility",
"when": "activeViewlet == 'workbench.view.extension.gitlens'"
}
]
/*
* Ctrl+Shift+P > settings
* Preferences: Open Settings (JSON)
*/
{
// Style and Theme
"workbench.colorTheme": "Bearded Theme Monokai Reversed",
"workbench.iconTheme": "symbols",
"editor.fontFamily": "Codelia Ligatures", // https://drive.google.com/file/d/1iwEhhk3l8VEa3H3zLtYaMF526NSTn_wR
"editor.fontSize": 14,
"editor.lineHeight": 19,
"editor.fontWeight": "400",
"editor.fontLigatures": true,
"editor.rulers": [80, 120],
"editor.renderLineHighlight": "all",
"editor.cursorBlinking": "smooth",
"editor.semanticHighlighting.enabled": false,
"editor.scrollbar.vertical": "auto",
"editor.scrollbar.horizontal": "auto",
"window.titleBarStyle": "custom",
// Custom Style
"apc.electron": {
"titleBarStyle": "hiddenInset",
"frame": false
},
"apc.header": {
"height": 36
},
"apc.listRow": {
"height": 22
},
"apc.font.family": "Inter", // https://fonts.google.com/specimen/Inter
"apc.stylesheet": {
// ".titlebar-center": "display: none !important",
".title-label > h2": "display: none",
".editor-actions": "display: none"
},
// Behavior
"editor.mouseWheelZoom": true,
"explorer.compactFolders": false,
"explorer.confirmDragAndDrop": false,
"explorer.confirmDelete": false,
"security.workspace.trust.untrustedFiles": "open",
"workbench.editor.enablePreview": false,
"editor.lightbulb.enabled": "off",
"editor.insertSpaces": true,
"editor.tabSize": 2,
// Languages Behavior
"typescript.preferences.importModuleSpecifier": "non-relative",
"typescript.updateImportsOnFileMove.enabled": "always",
"typescript.suggest.autoImports": true,
"javascript.preferences.importModuleSpecifier": "non-relative",
"javascript.updateImportsOnFileMove.enabled": "always",
"javascript.suggest.autoImports": true,
// Formatting
"prettier.printWidth": 80, // esbenp.prettier-vscode
"cSpell.language": "en,pt,pt_BR", // streetsidesoftware.code-spell-checker
"splitHTMLAttributes.closingBracketOnNewLine": true, // dannyconnell.split-html-attributes
"scss.lint.unknownAtRules": "ignore",
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// Organization
// "explorer.sortOrder": "foldersNestsFiles",
// "explorer.fileNesting.enabled": true,
// "explorer.fileNesting.patterns": {
// "package.json": "package-lock*, pnpm-lock*, bun.lockb, nest*",
// "docker*": ".docker*",
// "nest*": "nest*",
// "vite*": "vite*",
// "tsconfig*": "tsconfig*,",
// "prettier*": "prettier*",
// ".eslint*": ".eslint*",
// "tailwind.config*": "tailwind.config*, postcss.config*",
// ".env*": ".env*"
// },
"symbols.hidesExplorerArrows": false,
"breadcrumbs.enabled": false,
"editor.minimap.enabled": false,
"workbench.editor.labelFormat": "short",
"workbench.startupEditor": "newUntitledFile",
"window.commandCenter": false,
"workbench.layoutControl.enabled": false,
"parameterHints.enabled": false,
"workbench.activityBar.location": "hidden",
"workbench.statusBar.visible": false
}

To Install Extensions

Shortcut to call VSCode or VSCode Insiders on terminal

code <command> or

code-insiders <command>

List extensions

code --list-extensions on Windows or

code --list-extensions | xargs -L 1 echo code --install-extension on Linux

Install extensions

code --install-extension beardedbear.beardedtheme &&
code --install-extension bradlc.vscode-tailwindcss &&
code --install-extension dannyconnell.split-html-attributes &&
code --install-extension dbaeumer.vscode-eslint &&
code --install-extension dominicvonk.parameter-hints &&
code --install-extension drcika.apc-extension &&
code --install-extension esbenp.prettier-vscode &&
code --install-extension formulahendry.auto-close-tag &&
code --install-extension formulahendry.auto-rename-tag &&
code --install-extension github.copilot &&
code --install-extension github.copilot-chat &&
code --install-extension golang.go &&
code --install-extension kamikillerto.vscode-colorize &&
code --install-extension markthomasmiller.sorcerer &&
code --install-extension meganrogge.template-string-converter &&
code --install-extension miguelsolorio.symbols &&
code --install-extension ms-vscode-remote.remote-wsl &&
code --install-extension ms-vscode.vscode-typescript-next &&
code --install-extension patbenatar.advanced-new-file &&
code --install-extension prisma.prisma &&
code --install-extension ryuta46.multi-command &&
code --install-extension steoates.autoimport &&
code --install-extension streetsidesoftware.code-spell-checker &&
code --install-extension streetsidesoftware.code-spell-checker-portuguese-brazilian &&
code --install-extension yoavbls.pretty-ts-errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment