Skip to content

Instantly share code, notes, and snippets.

@colinjfw
Created September 3, 2021 15:05
Show Gist options
  • Save colinjfw/614660c90606dd8a1d4e6e46b5c2eea8 to your computer and use it in GitHub Desktop.
Save colinjfw/614660c90606dd8a1d4e6e46b5c2eea8 to your computer and use it in GitHub Desktop.
VSCode
// Place your key bindings in this file to override the defaults
[
// New file uses cmd+n and a new folder uses cmd+shift+n (or ctrl).
{
"key": "cmd+n",
"command": "explorer.newFile",
"when": "explorerViewletFocus"
},
{
"key": "cmd+enter",
"command": "-renameFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus"
},
{
"key": "ctrl+n",
"command": "-list.focusDown",
"when": "listFocus && !inputFocus"
},
{
"key": "ctrl+n",
"command": "explorer.newFile",
"when": "explorerViewletFocus"
},
{
"key": "ctrl+shift+n",
"command": "explorer.newFolder"
},
// Press r to rename a file in the explorer.
{
"key": "r",
"command": "renameFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus"
},
// Regular enter to open a file.
{
"key": "enter",
"command": "list.select",
"when": "explorerViewletVisible && filesExplorerFocus && !inputFocus"
},
// Use ctrl+` to toggle the terminal.
{
"key": "ctrl+`",
"command": "workbench.action.terminal.toggleTerminal",
"when": "terminalFocus"
},
{
"key": "ctrl+`",
"command": "workbench.action.terminal.focus",
"when": "!terminalFocus"
},
{
"key": "ctrl+`",
"command": "workbench.action.terminal.focus",
"when": "!terminalFocus"
},
// Use ctrl+s to save files.
{
"key": "ctrl+s",
"command": "workbench.action.files.save"
},
// Navigate editors using ctrl+k and ctrl+j.
{
"key": "ctrl+k",
"command": "workbench.action.nextEditor"
},
{
"key": "ctrl+j",
"command": "workbench.action.nextEditor"
},
{
"key": "ctrl+j",
"command": "-extension.vim_ctrl+j",
"when": "editorTextFocus && vim.active && vim.use<C-j> && !inDebugRepl"
},
{
"key": "ctrl+j",
"command": "-editor.action.joinLines",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+k",
"command": "-extension.vim_ctrl+k",
"when": "editorTextFocus && vim.active && vim.use<C-k> && !inDebugRepl"
},
{
"key": "ctrl+k",
"command": "-deleteAllRight",
"when": "textInputFocus && !editorReadonly"
},
// Navigate to the file explorer using ctrl+e.
{
"key": "ctrl+e",
"command": "workbench.view.explorer"
},
{
"key": "shift+cmd+e",
"command": "-workbench.view.explorer"
},
{
"key": "ctrl+e",
"command": "-extension.vim_ctrl+e",
"when": "editorTextFocus && vim.active && vim.use<C-e> && !inDebugRepl"
},
{
"key": "ctrl+e",
"command": "-cursorLineEnd",
"when": "textInputFocus"
},
// Tab will cycle through autocomplete.
{ "key": "tab", "command": "selectNextSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" },
// Show SCM using ctrl+g.
{
"key": "ctrl+g",
"command": "workbench.view.scm",
},
{
"key": "ctrl+g",
"command": "-extension.vim_ctrl+g",
"when": "editorTextFocus && vim.active && vim.use<C-g> && !inDebugRepl"
},
{
"key": "ctrl+g",
"command": "-workbench.action.gotoLine"
},
// Use ctrl+p for the command palette.
{
"key": "ctrl+p",
"command": "workbench.action.showCommands"
},
{
"key": "shift+cmd+p",
"command": "-workbench.action.showCommands"
},
{
"key": "ctrl+p",
"command": "-extension.vim_ctrl+p",
"when": "suggestWidgetVisible && vim.active && vim.use<C-p>"
},
{
"key": "shift+cmd+p",
"command": "-workbench.action.showCommands"
},
{
"key": "ctrl+p",
"command": "-cursorUp",
"when": "textInputFocus"
},
{
"key": "ctrl+p",
"command": "-workbench.action.quickOpenSelectPrevious",
"when": "inQuickOpen"
},
{
"key": "ctrl+p",
"command": "-list.focusUp",
"when": "listFocus && !inputFocus"
},
{
"key": "ctrl+p",
"command": "-selectPrevSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
{
"key": "ctrl+p",
"command": "-showPrevParameterHint",
"when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible"
},
// Close window with ctrl+w.
{
"key": "ctrl+w",
"command": "workbench.action.closeActiveEditor"
},
{
"key": "ctrl+w",
"command": "-extension.vim_ctrl+w",
"when": "editorTextFocus && vim.active && vim.use<C-w> && !inDebugRepl"
},
{
"key": "ctrl+w",
"command": "-workbench.action.switchWindow"
},
{
"key": "cmd+w",
"command": "-workbench.action.closeActiveEditor"
},
// Use ctrl+m to view problems.
{
"key": "ctrl+m",
"command": "editor.action.marker.nextInFiles",
"when": "editorFocus && !editorReadonly"
},
{
"key": "f8",
"command": "-editor.action.marker.nextInFiles",
"when": "editorFocus && !editorReadonly"
},
]
{
"editor.minimap.enabled": false, // removes minimap
"editor.renderWhitespace": "none", // removes whitespace chars
"editor.renderIndentGuides": false, // removes indent guides
"editor.renderLineHighlight": "none", // removes line highlight
"editor.overviewRulerBorder": false, // removes border from overview ruler (located on the right, same position as the scrollbar)
"editor.hideCursorInOverviewRuler": true, // hides cursor mark in the overview ruler
// "editor.folding": false, // removes the folding feature
"editor.occurrencesHighlight": false, // removes highlights occurrences (still works when you select a word)
"editor.matchBrackets": false, // removes the highlight of matching brackets (I use Subtle Match Brackets extension for this)
"editor.glyphMargin": false, // removes the space used mainly for debugging indicators
"explorer.openEditors.visible": 0, // removes the open editors section at the top of the sidebar, you can see the opened files with ⌘ + ⌥ + Tab
"workbench.activityBar.visible": false, // removes the activity bar (the 4 icons at the left of the screen), so now you will have to open the explorer, git, debugger and extension with shortcuts or through the Command Palette
"workbench.editor.showIcons": false, // removes icon from opened files in tabs
"workbench.editor.tabCloseButton": "off", // removes cross icon from tabs
"workbench.statusBar.visible": false, // removes the status bar
"indenticator.color.dark": "rgba(255,255,255,.1)", // adds a subtle indent guide (needs Indenticator extension)
"workbench.colorCustomizations": { // object that allows you to customize your color theme: https://code.visualstudio.com/docs/getstarted/theme-color-reference
"tab.activeBorder": "#0000" // removes border to highlight active tabs (the colors formats are: #RGB, #RGBA, #RRGGBB or #RRGGBBAA)
},
"editor.fontFamily": "Inconsolata, monospace",
"editor.fontSize": 13,
"window.zoomLevel": 0,
"editor.rulers": [
80
],
"sync.gist": "311ae770e56353cb71dfcb19890f1ff9",
"explorer.confirmDragAndDrop": false,
"go.formatTool": "goimports"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment