chore(cursor): further tweaks to keybindings and settings

This commit is contained in:
Jim Myhrberg
2025-02-11 22:40:02 +00:00
parent e42f9794a5
commit 7766d46bd3
2 changed files with 224 additions and 105 deletions

View File

@@ -1,339 +1,427 @@
[ [
// //
// ===========================================================================
// Command Palette // Command Palette
// ===========================================================================
// //
{ { // Show commands.
"key": "ctrl+x m", "key": "ctrl+x m",
"command": "workbench.action.showCommands" "command": "workbench.action.showCommands"
}, },
{ { // Show commands.
"key": "ctrl+x ctrl+m", "key": "ctrl+x ctrl+m",
"command": "workbench.action.showCommands" "command": "workbench.action.showCommands"
}, },
{ { // Show commands.
"key": "ctrl+x enter", "key": "ctrl+x enter",
"command": "workbench.action.showCommands" "command": "workbench.action.showCommands"
}, },
{ { // Show commands.
"key": "alt+x", "key": "alt+x",
"command": "workbench.action.showCommands" "command": "workbench.action.showCommands"
}, },
// //
// ===========================================================================
// Save // Save
// ===========================================================================
// //
{ { // Save file.
"key": "ctrl+x ctrl+s", "key": "ctrl+x ctrl+s",
"command": "workbench.action.files.save" "command": "workbench.action.files.save"
}, },
// //
// ===========================================================================
// File open // File open
// ===========================================================================
// //
{ { // Open file via file browser extension.
"key": "ctrl+x ctrl+f", "key": "ctrl+x ctrl+f",
"command": "file-browser.open", "command": "file-browser.open",
"when": "editorTextFocus" "when": "editorTextFocus"
}, },
{ { // Open quick open.
"key": "ctrl+x ctrl+;", "key": "ctrl+x ctrl+;",
"command": "workbench.action.quickOpen" "command": "workbench.action.quickOpen"
}, },
// //
// ===========================================================================
// File rename // File rename
// ===========================================================================
// //
{ { // Rename file via file browser extension.
"key": "ctrl+c r", "key": "ctrl+c r",
"command": "file-browser.rename" "command": "file-browser.rename"
}, },
// //
// ===========================================================================
// Switch and close editor // Switch and close editor
// ===========================================================================
// //
{ { // Show all editors by most recently used.
"key": "ctrl+x ctrl+b", "key": "ctrl+x ctrl+b",
"command": "workbench.action.showAllEditorsByMostRecentlyUsed", "command": "workbench.action.showAllEditorsByMostRecentlyUsed",
"when": "!terminalFocus" "when": "!terminalFocus"
}, },
{ { // Close active editor.
"key": "ctrl+x ctrl+k", "key": "ctrl+x ctrl+k",
"command": "workbench.action.closeActiveEditor", "command": "workbench.action.closeActiveEditor",
"when": "!terminalFocus" "when": "!terminalFocus"
}, },
// //
// ===========================================================================
// Fullscreen // Fullscreen
// ===========================================================================
// //
{ { // Toggle fullscreen.
"key": "ctrl+cmd+enter", "key": "ctrl+cmd+enter",
"command": "workbench.action.toggleFullScreen", "command": "workbench.action.toggleFullScreen",
"when": "!isIOS" "when": "!isIOS"
}, },
{ { // Toggle fullscreen.
"key": "cmd+enter", "key": "cmd+enter",
"command": "workbench.action.toggleFullScreen", "command": "workbench.action.toggleFullScreen",
"when": "!isIOS" "when": "!isIOS"
}, },
{ { // Disable default toggle fullscreen keybinding.
"key": "ctrl+cmd+f", "key": "ctrl+cmd+f",
"command": "-workbench.action.toggleFullScreen", "command": "-workbench.action.toggleFullScreen",
"when": "!isIOS" "when": "!isIOS"
}, },
// //
// ===========================================================================
// Navigation // Navigation
// ===========================================================================
// //
{ { // Focus next editor group.
"key": "ctrl+x ctrl+o", "key": "ctrl+x ctrl+o",
"command": "workbench.action.focusNextGroup", "command": "workbench.action.focusNextGroup",
"when": "!terminalFocus" "when": "!terminalFocus"
}, },
{ { // Focus previous editor group.
"key": "ctrl+x ctrl+i", "key": "ctrl+x ctrl+i",
"command": "workbench.action.focusPreviousGroup", "command": "workbench.action.focusPreviousGroup",
"when": "!terminalFocus" "when": "!terminalFocus"
}, },
// //
// ===========================================================================
// Pane navigation // Pane navigation
// ===========================================================================
// //
{ { // Navigate up.
"key": "alt+i", "key": "alt+i",
"command": "workbench.action.navigateUp" "command": "workbench.action.navigateUp"
}, },
// Workaround for alt+i not working in VSCode. { // Navigate up.
{ // Workaround for alt+i not working in VSCode. Relies on
// Karabiner-Elements to remap alt+i to cmd+alt+up.
"key": "cmd+alt+up", "key": "cmd+alt+up",
"command": "workbench.action.navigateUp" "command": "workbench.action.navigateUp"
}, },
{ { // Navigate right.
"key": "alt+l", "key": "alt+l",
"command": "workbench.action.navigateRight" "command": "workbench.action.navigateRight"
}, },
{ { // Navigate left.
"key": "alt+j", "key": "alt+j",
"command": "workbench.action.navigateLeft" "command": "workbench.action.navigateLeft"
}, },
{ { // Navigate down.
"key": "alt+k", "key": "alt+k",
"command": "workbench.action.navigateDown" "command": "workbench.action.navigateDown"
}, },
// //
// ===========================================================================
// Move active editor group // Move active editor group
// ===========================================================================
// //
{ { // Move active editor group up.
"key": "shift+alt+k", "key": "ctrl+shift+i",
"command": "workbench.action.moveActiveEditorGroupDown"
},
{
"key": "shift+alt+j",
"command": "workbench.action.moveActiveEditorGroupLeft"
},
{
"key": "shift+alt+cmd+up",
"command": "workbench.action.moveActiveEditorGroupUp" "command": "workbench.action.moveActiveEditorGroupUp"
}, },
{ { // Move active editor group down.
"key": "shift+alt+l", "key": "ctrl+shift+k",
"command": "workbench.action.moveActiveEditorGroupDown"
},
{ // Move active editor group left.
"key": "ctrl+shift+j",
"command": "workbench.action.moveActiveEditorGroupLeft"
},
{ // Move active editor group right.
"key": "ctrl+shift+l",
"command": "workbench.action.moveActiveEditorGroupRight" "command": "workbench.action.moveActiveEditorGroupRight"
}, },
// //
// ===========================================================================
// Move active editor into group // Move active editor into group
// ===========================================================================
// //
{ { // Move active editor into group above.
"key": "ctrl+shift+i", "key": "alt+shift+i",
"command": "workbench.action.moveEditorToAboveGroup" "command": "workbench.action.moveEditorToAboveGroup"
}, },
{ { // Move active editor into group above.
"key": "ctrl+shift+k", // Workaround for alt+i not working in VSCode. Relies on
// Karabiner-Elements to remap alt+i to cmd+alt+up.
"key": "cmd+alt+shift+up",
"command": "workbench.action.moveEditorToAboveGroup"
},
{ // Move active editor into group below.
"key": "alt+shift+k",
"command": "workbench.action.moveEditorToBelowGroup" "command": "workbench.action.moveEditorToBelowGroup"
}, },
{ { // Move active editor into group left.
"key": "ctrl+shift+j", "key": "alt+shift+j",
"command": "workbench.action.moveEditorToLeftGroup" "command": "workbench.action.moveEditorToLeftGroup"
}, },
{ { // Move active editor into group right.
"key": "ctrl+shift+l", "key": "alt+shift+l",
"command": "workbench.action.moveEditorToRightGroup" "command": "workbench.action.moveEditorToRightGroup"
}, },
// //
// ===========================================================================
// Undo/redo // Undo/redo
// ===========================================================================
// //
{ { // Undo.
"key": "alt+-", "key": "alt+-",
"command": "undo", "command": "undo",
"when": "editorTextFocus && !editorReadonly" "when": "editorTextFocus && !editorReadonly"
}, },
{ { // Redo.
"key": "shift+alt+-", "key": "shift+alt+-",
"command": "redo", "command": "redo",
"when": "editorTextFocus && !editorReadonly" "when": "editorTextFocus && !editorReadonly"
}, },
// //
// ===========================================================================
// Text navigation // Text navigation
// ===========================================================================
// //
{ { // Go to symbol definition.
"key": "ctrl+t", "key": "ctrl+t",
"command": "workbench.action.gotoSymbol", "command": "workbench.action.gotoSymbol",
"when": "editorTextFocus" "when": "editorTextFocus"
}, },
{ { // Jump to definition.
"key": "ctrl+c ctrl+j", "key": "ctrl+c ctrl+j",
"command": "editor.action.revealDefinition" "command": "editor.action.revealDefinition"
}, },
{ { // Navigate back.
"key": "alt+g b", "key": "alt+g b",
"command": "workbench.action.navigateBack" "command": "workbench.action.navigateBack"
}, },
{ { // Navigate back.
"key": "alt+g alt+b",
"command": "workbench.action.navigateBack"
},
{ // Peek symbol references.
"key": "alt+shift+/", "key": "alt+shift+/",
"command": "editor.action.referenceSearch.trigger", "command": "editor.action.referenceSearch.trigger",
"when": "editorHasReferenceProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor" "when": "editorHasReferenceProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
}, },
// //
// ===========================================================================
// Text manipulation // Text manipulation
// ===========================================================================
// //
{ { // Comment line.
"key": "ctrl+c /",
"command": "editor.action.commentLine",
"when": "editorTextFocus && !editorReadonly"
},
{ // Comment line.
"key": "ctrl+c ctrl+/", "key": "ctrl+c ctrl+/",
"command": "editor.action.commentLine", "command": "editor.action.commentLine",
"when": "editorTextFocus && !editorReadonly" "when": "editorTextFocus && !editorReadonly"
}, },
{ { // Format document.
"key": "alt+p",
"command": "notebook.cell.moveUp",
"when": "notebookEditorFocused && !inputFocus"
},
{
"key": "alt+n",
"command": "notebook.cell.moveDown",
"when": "notebookEditorFocused && !inputFocus"
},
{
"key": "ctrl+c ctrl+f", "key": "ctrl+c ctrl+f",
"command": "editor.action.formatDocument", "command": "editor.action.formatDocument",
"when": "editorTextFocus && !editorReadonly" "when": "editorTextFocus && !editorReadonly"
}, },
// Workaround for alt+n not working in VSCode. { // Duplicate selection.
{
"key": "alt+cmd+down",
"command": "notebook.cell.moveDown",
"when": "notebookEditorFocused && !inputFocus"
},
{
"key": "alt+p",
"command": "editor.action.moveLinesUpAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "alt+n",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
// Workaround for alt+n not working in VSCode.
{
"key": "alt+cmd+down",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+x ctrl+d", "key": "ctrl+x ctrl+d",
"command": "editor.action.duplicateSelection" "command": "editor.action.duplicateSelection"
}, },
{ { // Rename thing at point.
"key": "ctrl+c ctrl+.", "key": "ctrl+c ctrl+.",
"command": "editor.action.rename", "command": "editor.action.rename",
"when": "editorHasRenameProvider && editorTextFocus && !editorReadonly" "when": "editorHasRenameProvider && editorTextFocus && !editorReadonly"
}, },
{ // Move lines up in editor.
"key": "alt+p",
"command": "editor.action.moveLinesUpAction",
"when": "editorTextFocus && !editorReadonly"
},
{ // Move lines down in editor.
"key": "alt+n",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{ // Move lines down in editor.
// This is a workaround for alt+n not working in VSCode. Relies on
// Karabiner-Elements to remap alt+n to cmd+alt+down.
"key": "cmd+alt+down",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{ // Move cell up in notebook editor.
"key": "alt+p",
"command": "notebook.cell.moveUp",
"when": "notebookEditorFocused && !inputFocus"
},
{ // Move cell down in notebook editor.
"key": "alt+n",
"command": "notebook.cell.moveDown",
"when": "notebookEditorFocused && !inputFocus"
},
{ // Move cell down in notebook editor.
// This is a workaround for alt+n not working in VSCode. Relies on
// Karabiner-Elements to remap alt+n to cmd+alt+down.
"key": "cmd+alt+down",
"command": "notebook.cell.moveDown",
"when": "notebookEditorFocused && !inputFocus"
},
// //
// ===========================================================================
// Completion // Completion
// ===========================================================================
// //
{ {
"key": "alt+shift+f", "key": "alt+shift+f",
"command": "editor.action.inlineSuggest.acceptNextWord" "command": "editor.action.inlineSuggest.acceptNextWord"
}, },
// //
// Multi-cusor // ===========================================================================
// Text selection
// ===========================================================================
// //
{ { // Expand selection.
"key": "alt+m", "key": "alt+.",
"command": "editor.action.insertCursorAbove", "command": "editor.action.smartSelect.expand",
"when": "editorTextFocus" "when": "editorTextFocus"
}, },
{ { // Shrink/contract selection.
"key": "alt+,",
"command": "editor.action.smartSelect.shrink",
"when": "editorTextFocus"
},
//
// ===========================================================================
// Multi-cusor
// ===========================================================================
//
{ // Select all highlights.
"key": "shift+cmd+a",
"command": "editor.action.selectHighlights",
"when": "editorFocus"
},
{ // Disable default insert cursor above keybinding.
"key": "alt+cmd+up", "key": "alt+cmd+up",
"command": "-editor.action.insertCursorAbove", "command": "-editor.action.insertCursorAbove",
"when": "editorTextFocus" "when": "editorTextFocus"
}, },
{ { // Insert cursor above.
"key": "alt+/", "key": "alt+m",
"command": "editor.action.insertCursorBelow", "command": "editor.action.insertCursorAbove",
"when": "editorTextFocus" "when": "editorTextFocus && !editorHasSelection"
}, },
{ { // Add selection to previous find match when editor has selection.
"key": "alt+m",
"command": "emacs-mcx.addSelectionToPreviousFindMatch",
"when": "editorTextFocus && editorHasSelection"
},
{ // Disable default insert cursor below keybinding.
"key": "alt+cmd+down", "key": "alt+cmd+down",
"command": "-editor.action.insertCursorBelow", "command": "-editor.action.insertCursorBelow",
"when": "editorTextFocus" "when": "editorTextFocus"
}, },
{ // Insert cursor below when editor has no selection.
"key": "alt+/",
"command": "editor.action.insertCursorBelow",
"when": "editorTextFocus && !editorHasSelection"
},
{ // Add selection to next find match when editor has selection.
"key": "alt+/",
"command": "emacs-mcx.addSelectionToNextFindMatch",
"when": "editorTextFocus && editorHasSelection"
},
// //
// ===========================================================================
// edamagit // edamagit
// ===========================================================================
// //
{ { // Open magit status.
"key": "ctrl+x g", "key": "ctrl+x g",
"command": "magit.status" "command": "magit.status"
}, },
{ { // Disable default open magit status keybinding.
"key": "alt+x g", "key": "alt+x g",
"command": "-magit.status" "command": "-magit.status"
}, },
// //
// ===========================================================================
// Project Manager // Project Manager
// ===========================================================================
// //
{ { // List projects.
"key": "ctrl+z ctrl+s", "key": "ctrl+z ctrl+s",
"command": "projectManager.listProjects" "command": "projectManager.listProjects"
}, },
{ { // Disable default list projects keybinding.
"key": "alt+cmd+p", "key": "alt+cmd+p",
"command": "-projectManager.listProjects" "command": "-projectManager.listProjects"
}, },
// //
// ===========================================================================
// dired // dired
// ===========================================================================
// //
{ { // Open dired.
"key": "ctrl+x ctrl+j", "key": "ctrl+x ctrl+j",
"command": "extension.dired.open", "command": "extension.dired.open",
"when": "editorTextFocus && !inDebugRepl" "when": "editorTextFocus && !inDebugRepl"
}, },
{ { // Disable default open dired keybinding.
"key": "ctrl+x f", "key": "ctrl+x f",
"command": "-extension.dired.open", "command": "-extension.dired.open",
"when": "editorTextFocus && !inDebugRepl" "when": "editorTextFocus && !inDebugRepl"
}, },
{ { // Create directory.
"key": "c", "key": "c",
"command": "extension.dired.createDir", "command": "extension.dired.createDir",
"when": "dired.open && !findWidgetVisible && !inQuickOpen" "when": "dired.open && !findWidgetVisible && !inQuickOpen"
}, },
{ { // Disable default create directory keybinding.
"key": "shift+=", "key": "shift+=",
"command": "-extension.dired.createDir", "command": "-extension.dired.createDir",
"when": "dired.open && !findWidgetVisible && !inQuickOpen" "when": "dired.open && !findWidgetVisible && !inQuickOpen"
}, },
{ { // Go up directory.
"key": "ctrl+l", "key": "ctrl+l",
"command": "extension.dired.goUpDir", "command": "extension.dired.goUpDir",
"when": "dired.open && !findWidgetVisible && !inQuickOpen" "when": "dired.open && !findWidgetVisible && !inQuickOpen"
}, },
{ { // Disable default go up directory keybinding.
"key": "shift+b", "key": "shift+b",
"command": "-extension.dired.goUpDir", "command": "-extension.dired.goUpDir",
"when": "dired.open && !findWidgetVisible && !inQuickOpen" "when": "dired.open && !findWidgetVisible && !inQuickOpen"
}, },
// //
// ===========================================================================
// swiper // swiper
// ===========================================================================
// //
{ { // Swiper word at cursor.
"key": "alt+r", "key": "alt+r",
"command": "swiper.swiper-word-at-cursor" "command": "swiper.swiper-word-at-cursor"
}, },
// //
// ===========================================================================
// Makefile task runner // Makefile task runner
// ===========================================================================
// //
{ { // Run target.
"key": "ctrl+c enter", "key": "ctrl+c enter",
"command": "make-task-provider.runTarget" "command": "make-task-provider.runTarget"
} }

View File

@@ -1,12 +1,19 @@
{ {
// //
// ===========================================================================
// Theme // Theme
// ===========================================================================
// //
"workbench.colorTheme": "One Dark Pro", "workbench.colorTheme": "One Dark Pro",
// //
// ===========================================================================
// Editor // Editor
// ===========================================================================
// //
"editor.fontFamily": "'Menlo Nerd Font Mono', 'Menlo Nerd Font', Menlo, Monaco, 'Courier New', monospace", "editor.fontFamily": "'Menlo Nerd Font Mono', 'Menlo Nerd Font', Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": false,
"editor.fontWeight": "normal",
"editor.fontSize": 12,
"editor.renderWhitespace": "trailing", "editor.renderWhitespace": "trailing",
"editor.formatOnSave": true, "editor.formatOnSave": true,
"editor.formatOnPaste": false, "editor.formatOnPaste": false,
@@ -19,13 +26,17 @@
"editor.accessibilitySupport": "off", "editor.accessibilitySupport": "off",
"editor.minimap.enabled": true, "editor.minimap.enabled": true,
// //
// ===========================================================================
// Files // Files
// ===========================================================================
// //
"files.trimTrailingWhitespace": true, "files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true, "files.insertFinalNewline": true,
"files.trimFinalNewlines": true, "files.trimFinalNewlines": true,
// //
// ===========================================================================
// Cursor // Cursor
// ===========================================================================
// //
"cursor.aipreview.enabled": true, "cursor.aipreview.enabled": true,
"cursor.cpp.enablePartialAccepts": true, "cursor.cpp.enablePartialAccepts": true,
@@ -33,28 +44,38 @@
"cursor.terminal.usePreviewBox": true, "cursor.terminal.usePreviewBox": true,
"cursor.general.enableShadowWorkspace": true, "cursor.general.enableShadowWorkspace": true,
// //
// ===========================================================================
// Window // Window
// ===========================================================================
// //
"window.nativeFullScreen": false, "window.nativeFullScreen": false,
"window.commandCenter": true, "window.commandCenter": true,
// //
// ===========================================================================
// Terminal // Terminal
// ===========================================================================
// //
"terminal.integrated.persistentSessionScrollback": 1000, "terminal.integrated.persistentSessionScrollback": 1000,
"terminal.integrated.scrollback": 10000, "terminal.integrated.scrollback": 10000,
// //
// ===========================================================================
// Awesome Emacs Keybindings // Awesome Emacs Keybindings
// ===========================================================================
// //
"emacs-mcx.emacsLikeTab": true, "emacs-mcx.emacsLikeTab": true,
"emacs-mcx.killRingMax": 120, "emacs-mcx.killRingMax": 120,
"emacs-mcx.markRingMax": 32, "emacs-mcx.markRingMax": 32,
// //
// ===========================================================================
// File Browser // File Browser
// ===========================================================================
// //
"file-browser.hideDotfiles": false, "file-browser.hideDotfiles": false,
"file-browser.labelIgnoredFiles": true, "file-browser.labelIgnoredFiles": true,
// //
// ===========================================================================
// Project Manager // Project Manager
// ===========================================================================
// //
"projectManager.git.baseFolders": [ "projectManager.git.baseFolders": [
"~/Projects", "~/Projects",
@@ -108,21 +129,27 @@
"elpaca" "elpaca"
], ],
// //
// ===========================================================================
// Go // Go
// ===========================================================================
// //
"go.formatTool": "gofumpt", "go.formatTool": "gofumpt",
"go.inlayHints.constantValues": true, "go.inlayHints.constantValues": true,
"go.lintTool": "golangci-lint", "go.lintTool": "golangci-lint",
"go-lines.lineLength": 120, "go-lines.lineLength": 120,
// //
// ===========================================================================
// JSON // JSON
// ===========================================================================
// //
"[json]": { "[json]": {
"editor.insertSpaces": true, "editor.insertSpaces": true,
"editor.tabSize": 2 "editor.tabSize": 2
}, },
// //
// ===========================================================================
// Ruby // Ruby
// ===========================================================================
// //
"[ruby]": { "[ruby]": {
"editor.defaultFormatter": "Shopify.ruby-lsp", "editor.defaultFormatter": "Shopify.ruby-lsp",
@@ -132,11 +159,15 @@
"editor.tabSize": 2 "editor.tabSize": 2
}, },
// //
// ===========================================================================
// YAML (by RedHat) // YAML (by RedHat)
// ===========================================================================
// //
"redhat.telemetry.enabled": false, "redhat.telemetry.enabled": false,
// //
// ===========================================================================
// Makefile // Makefile
// ===========================================================================
// //
"makefile.configureOnOpen": true "makefile.configureOnOpen": true
} }