### Debugging Remapping Output Examples Source: https://github.com/vscodevim/vim/wiki/Remapping-keys Examples of log messages seen in the Vim Output panel during debugging. These show successful remapping configurations and indicate potential errors like invalid configurations. ```console debug: Remapper: normalModeKeyBindingsNonRecursive. before=0. after=^. debug: Remapper: insertModeKeyBindings. before=j,j. after=. error: Remapper: insertModeKeyBindings. Invalid configuration. Missing 'after' key or 'commands'. before=j,k. ``` -------------------------------- ### Configure Auto Input Method Switching (Windows) Source: https://github.com/vscodevim/vim/wiki/Plugins Enable automatic input method switching and configure commands for Windows. Requires im-select.exe to be installed. ```json { "vim.autoSwitchInputMethod.enable": true, "vim.autoSwitchInputMethod.defaultIM": "1033", "vim.autoSwitchInputMethod.obtainIMCmd": "D:\\bin\\im-select.exe", "vim.autoSwitchInputMethod.switchIMCmd": "D:\\bin\\im-select.exe {im}" } ``` -------------------------------- ### Debugging Key Event Handling Examples Source: https://github.com/vscodevim/vim/wiki/Remapping-keys Examples of key events logged by the ModeHandler in the Vim Output panel. These logs help verify if VSCodeVim is receiving the key presses you intend to remap. ```console debug: ModeHandler: handling key=A. debug: ModeHandler: handling key=l. debug: ModeHandler: handling key=. debug: ModeHandler: handling key=. ``` -------------------------------- ### Configure Auto Input Method Switching (macOS) Source: https://github.com/vscodevim/vim/wiki/Plugins Enable automatic input method switching and configure commands for macOS. Requires im-select to be installed. ```json { "vim.autoSwitchInputMethod.enable": true, "vim.autoSwitchInputMethod.defaultIM": "com.apple.keylayout.US", "vim.autoSwitchInputMethod.obtainIMCmd": "/usr/local/bin/im-select", "vim.autoSwitchInputMethod.switchIMCmd": "/usr/local/bin/im-select {im}" } ``` -------------------------------- ### When Clause for Multiple Vim Modes Source: https://github.com/vscodevim/vim/blob/master/README.md Example of a 'when' clause context in keybindings.json that checks if Vim is currently in Normal or Visual mode. ```json "when": "vim.mode == 'Normal' || vim.mode == 'Visual'" ``` -------------------------------- ### VSCodeVim Settings Example Source: https://github.com/vscodevim/vim/blob/master/README.md A sample settings.json file demonstrating common VSCodeVim configurations. This includes easy motion, incremental search, system clipboard usage, control key bindings, highlight search, custom insert and normal mode key bindings, leader key configuration, and handling specific key presses. It also shows an experimental setting to improve performance. ```json { "vim.easymotion": true, "vim.incsearch": true, "vim.useSystemClipboard": true, "vim.useCtrlKeys": true, "vim.hlsearch": true, "vim.insertModeKeyBindings": [ { "before": ["j", "j"], "after": [""] } ], "vim.normalModeKeyBindingsNonRecursive": [ { "before": ["", "d"], "after": ["d", "d"] }, { "before": [""], "commands": [":nohl"] }, { "before": ["K"], "commands": ["lineBreakInsert"], "silent": true } ], "vim.leader": "", "vim.handleKeys": { "": false, "": false }, // To improve performance "extensions.experimental.affinity": { "vscodevim.vim": 1 } } ``` -------------------------------- ### Remap 'vim' to Clone Repository in Visual Mode Source: https://github.com/vscodevim/vim/wiki/Remapping-keys Use 'vim.visualModeKeyBindings' to execute commands with arguments in visual mode. This example maps 'vim' to clone a specific Git repository. ```json "vim.visualModeKeyBindings": [ { "before": [ "", "v", "i", "m" ], "commands": [ { "command": "git.clone", "args": [ "https://github.com/VSCodeVim/Vim.git" ] } ] } ] ``` -------------------------------- ### Remap Leader Keys for Bookmarks Extension Source: https://github.com/vscodevim/vim/wiki/Remapping-keys Use 'vim.normalModeKeyBindings' to trigger commands from extensions. This example maps 'm' to toggle bookmarks and 'b' to list them. ```json "vim.normalModeKeyBindings": [ { "before": ["", "m"], "commands": [ "bookmarks.toggle" ] }, { "before": ["", "b"], "commands": [ "bookmarks.list" ] } ] ``` -------------------------------- ### Remap ':' to Show Command Palette Silently Source: https://github.com/vscodevim/vim/wiki/Remapping-keys Use 'vim.normalModeKeyBindings' to map keys to VS Code commands. This example binds ':' to 'workbench.action.showCommands' and suppresses status bar messages. ```json "vim.normalModeKeyBindings": [ { "before": [":"], "commands": [ "workbench.action.showCommands" ], "silent": true } ] ``` -------------------------------- ### Remap '£' to '#' in Normal Mode Source: https://github.com/vscodevim/vim/wiki/Remapping-keys Use 'vim.normalModeKeyBindings' to override keys in normal mode. This example maps the '£' character to the '#' character. ```json "vim.normalModeKeyBindings": [ { "before": ["£"], "after": ["#"] } ] ``` -------------------------------- ### Remap j to k and k to j in Normal Mode (Non-Recursive) Source: https://github.com/vscodevim/vim/wiki/Remapping-keys Use non-recursive keybindings to prevent infinite loops when remapping keys. This example swaps the functionality of 'j' and 'k' in normal mode. ```json "vim.normalModeKeyBindingsNonRecursive": [ { "before": ["j"], "after": ["k"] }, { "before": ["k"], "after": ["j"] } ] ``` -------------------------------- ### Remap '>' and '<' for Indenting in Visual Mode Source: https://github.com/vscodevim/vim/wiki/Remapping-keys Use 'vim.visualModeKeyBindings' to map keys to VS Code commands in visual mode. This example binds '>' to indent and '<' to outdent lines. ```json "vim.visualModeKeyBindings": [ { "before": [ ">" ], "commands": [ "editor.action.indentLines" ] }, { "before": [ "<" ], "commands": [ "editor.action.outdentLines" ] } ] ``` -------------------------------- ### Remap Ctrl+N and Leader+W in Normal Mode Source: https://github.com/vscodevim/vim/wiki/Remapping-keys Use 'vim.normalModeKeyBindings' to map key combinations to VS Code actions. This example binds '' to clear search highlighting and 'w' to save the file. ```json "vim.normalModeKeyBindings": [ { "before":[""], "commands": [ ":nohl" ] }, { "before": ["leader", "w"], "commands": [ "workbench.action.files.save" ] } ] ``` -------------------------------- ### Remap ctrl+shift+y to yy in Normal Mode using keybindings.json Source: https://github.com/vscodevim/vim/wiki/Remapping-keys This example demonstrates how to remap a complex key combination (Ctrl+Shift+Y) to a Vim command ('yy') using VSCode's keybindings.json file. It specifies the key, the command to use ('vim.remap'), the condition for activation ('inputFocus && vim.mode == 'Normal''), and the desired Vim action ('after': ['y', 'y']). ```json { "key": "ctrl+shift+y", "command": "vim.remap", "when": "inputFocus && vim.mode == 'Normal'", "args": { "after": ["y", "y"] } } ``` -------------------------------- ### Remap '{' in Operator Pending Mode Source: https://github.com/vscodevim/vim/wiki/Remapping-keys Use 'vim.operatorPendingModeKeyBindings' to modify behavior in operator-pending mode. This example makes '{' behave like 'w' for operators like 'y' and 'd'. ```json "vim.operatorPendingModeKeyBindings": [ { "before": ["{"], "after": ["w"] } ] ``` -------------------------------- ### Remap 'jj' to Escape in Insert Mode Source: https://github.com/vscodevim/vim/wiki/Remapping-keys Use 'vim.insertModeKeyBindings' to map a key sequence to a specific action. This example binds 'jj' to the Escape key in insert mode. ```json "vim.insertModeKeyBindings": [ { "before": ["j", "j"], "after": [""] } ] ``` -------------------------------- ### Remap 'L' and 'H' in Operator Pending Mode Source: https://github.com/vscodevim/vim/wiki/Remapping-keys Use 'vim.operatorPendingModeKeyBindings' to customize operator-pending mode. This example maps 'L' to '$' and 'H' to '^' for actions like 'y' and 'd'. ```json "vim.operatorPendingModeKeyBindings": [ { "before": ["L"], "after": ["$"] }, { "before": ["H"], "after": ["^"] } ] ``` -------------------------------- ### Configure .vimrc Support Source: https://github.com/vscodevim/vim/blob/master/README.md Enable and configure the path for .vimrc support. This feature is experimental and only supports remaps. ```json "vim.vimrc.enable": true, "vim.vimrc.path": "~/.vimrc" ``` -------------------------------- ### Enable and Configure .vimrc Path Source: https://github.com/vscodevim/vim/wiki/.vimrc Add these settings to your VSCode settings.json to enable .vimrc support and specify its location. Ensure the path is correct for your system. ```json "vim.vimrc.enable": true, "vim.vimrc.path": "~/.vimrc", ``` -------------------------------- ### Bind > and < in Visual Mode for Indent/Outdent Source: https://github.com/vscodevim/vim/blob/master/README.md Configure '>' and '<' keys in visual mode to execute 'editor.action.indentLines' and 'editor.action.outdentLines' respectively. This allows for repeatable line indentation and outdentation. ```json "vim.visualModeKeyBindings": [ { "before": [ "> ], "commands": [ "editor.action.indentLines" ] }, { "before": [ "< ], "commands": [ "editor.action.outdentLines" ] }, ] ``` -------------------------------- ### Custom Keybinding Configuration Source: https://github.com/vscodevim/vim/blob/master/README.md A template for adding custom keybindings in VS Code's keybindings.json. Use this for remapping keys not fully supported by VSCodeVim's native remapping commands. ```json { "key": "YOUR_KEY_COMBINATION", "command": "vim.remap", "when": "inputFocus && vim.mode == 'VIM_MODE_YOU_WANT_TO_REBIND'", "args": { "after": ["YOUR_VIM_ACTION"] } } ``` -------------------------------- ### Bind : to Show Commands Silently Source: https://github.com/vscodevim/vim/blob/master/README.md Configure the ':' key in normal mode to open the command palette without displaying a message on the status bar. Use 'silent': true to suppress status bar messages. ```json "vim.normalModeKeyBindings": [ { "before": [":"], "commands": [ "workbench.action.showCommands", ], "silent": true } ] ``` -------------------------------- ### Enable CamelCaseMotion Plugin Source: https://github.com/vscodevim/vim/wiki/Plugins Enable or disable the CamelCaseMotion plugin to improve navigation through camelCase and snake_case words. ```json { "vim.camelCaseMotion.enable": true } ``` -------------------------------- ### Remap ( to i( in Operator Pending Mode (Non-Recursive) Source: https://github.com/vscodevim/vim/wiki/Remapping-keys This configuration binds the '(' key in operator-pending mode to insert 'i('. ```json "vim.operatorPendingModeKeyBindingsNonRecursive": [ { "before": ["("], "after": ["i("] } ] ``` -------------------------------- ### Optimize VSCodeVim Performance Source: https://github.com/vscodevim/vim/wiki/Frequently-Asked-Questions Use the experimental affinity setting to potentially improve VSCodeVim performance. This assigns a dedicated core to the Vim extension. ```json { "extensions.experimental.affinity": { "vscodevim.vim": 1 } } ``` -------------------------------- ### Configure Cursor Movement with Word Wrapping Source: https://github.com/vscodevim/vim/wiki/Frequently-Asked-Questions Configure VS Code keybindings to allow the cursor to move by each display line when word wrapping is enabled. This restores default VS Code behavior for 'j' and 'k' keys. ```json { "key": "up", "command": "cursorUp", "when": "editorTextFocus && vim.active && !inDebugRepl && !suggestWidgetMultipleSuggestions && !suggestWidgetVisible" } ``` ```json { "key": "down", "command": "cursorDown", "when": "editorTextFocus && vim.active && !inDebugRepl && !suggestWidgetMultipleSuggestions && !suggestWidgetVisible" } ``` ```json { "key": "k", "command": "cursorUp", "when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode == 'Normal' && !suggestWidgetMultipleSuggestions && !suggestWidgetVisible" } ``` ```json { "key": "j", "command": "cursorDown", "when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode == 'Normal' && !suggestWidgetMultipleSuggestions && !suggestWidgetVisible" } ``` -------------------------------- ### Remap Command Line Access in VS Code Source: https://github.com/vscodevim/vim/wiki/Frequently-Asked-Questions Remap a key to show a VS Code quick-pick version of the command line. This is useful when in Zen mode or when the status bar is disabled. ```json { "key": "shift+;", "command": "vim.showQuickpickCmdLine", "when": "editorTextFocus && vim.mode != 'Insert'" } ``` ```json { "key": "shift+;", "command": "vim.showQuickpickCmdLine", "when": "inZenMode && vim.mode != 'Insert'" } ``` -------------------------------- ### Configure vim-airline Status Bar Colors Source: https://github.com/vscodevim/vim/wiki/Plugins Enable status bar color control and define custom colors for different Vim modes. Note that enabling this feature can lead to performance implications due to workspace setting overrides. ```json "vim.statusBarColorControl": true, "vim.statusBarColors.normal": ["#8FBCBB", "#434E5E"], "vim.statusBarColors.insert": "#BF616A", "vim.statusBarColors.visual": "#B48EAD", "vim.statusBarColors.visualline": "#B48EAD", "vim.statusBarColors.visualblock": "#A3BE8C", "vim.statusBarColors.replace": "#D08770", "vim.statusBarColors.commandlineinprogress": "#007ACC", "vim.statusBarColors.searchinprogressmode": "#007ACC", "vim.statusBarColors.easymotionmode": "#007ACC", "vim.statusBarColors.easymotioninputmode": "#007ACC", "vim.statusBarColors.surroundinputmode": "#007ACC" ``` -------------------------------- ### Configure vim-airline Status Bar Colors Source: https://github.com/vscodevim/vim/blob/master/README.md Enable status bar color control and define custom colors for different Vim modes when using the vim-airline plugin. Colors can be a single string for background or an array for background and foreground. ```json "vim.statusBarColorControl": true, "vim.statusBarColors.normal": ["#8FBCBB", "#434C5E"], "vim.statusBarColors.insert": "#BF616A", "vim.statusBarColors.visual": "#B48EAD", "vim.statusBarColors.visualline": "#B48EAD", "vim.statusBarColors.visualblock": "#A3BE8C", "vim.statusBarColors.replace": "#D08770", "vim.statusBarColors.commandlineinprogress": "#007ACC", "vim.statusBarColors.searchinprogressmode": "#007ACC", "vim.statusBarColors.easymotionmode": "#007ACC", "vim.statusBarColors.easymotioninputmode": "#007ACC", "vim.statusBarColors.surroundinputmode": "#007ACC" ``` -------------------------------- ### Bind Ctrl+n to Turn Off Search Highlighting Source: https://github.com/vscodevim/vim/blob/master/README.md Map 'ctrl+n' to ':nohl' to disable search highlighting in normal mode. This is useful for clearing search results visually. ```json "vim.normalModeKeyBindings": [ { "before":[""], "commands": [ ":nohl", ] }, { "before": ["leader", "w"], "commands": [ "workbench.action.files.save", ] } ] ``` -------------------------------- ### VSCodeVim Performance Affinity Setting Source: https://github.com/vscodevim/vim/blob/master/README.md Assign a dedicated affinity to the VSCodeVim extension to potentially improve performance. Reload or restart VSCode after applying this setting. Be aware that updating settings may cause the Vim plugin to reload. ```json "extensions.experimental.affinity": { "vscodevim.vim": 1 } ``` -------------------------------- ### Remap p to paste without overriding register in Visual Mode (Non-Recursive) Source: https://github.com/vscodevim/vim/wiki/Remapping-keys This snippet remaps 'p' in visual mode to paste using 'p' followed by 'g', 'v', 'y', ensuring the current register is not overridden. ```json "vim.visualModeKeyBindingsNonRecursive": [ { "before": [ "p", ], "after": [ "p", "g", "v", "y" ] } ], ``` -------------------------------- ### Disable Press and Hold for Key Repeat (macOS) Source: https://github.com/vscodevim/vim/blob/master/README.md Execute these commands in your Terminal to disable the press-and-hold behavior for key repeat in VS Code and related applications on macOS. Log out and back in, then restart VS Code for changes to take effect. A global reset option is also provided. ```sh defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false # For VS Code defaults write com.microsoft.VSCodeInsiders ApplePressAndHoldEnabled -bool false # For VS Code Insider defaults write com.vscodium ApplePressAndHoldEnabled -bool false # For VS Codium defaults write com.microsoft.VSCodeExploration ApplePressAndHoldEnabled -bool false # For VS Codium Exploration users defaults write com.exafunction.windsurf ApplePressAndHoldEnabled -bool false # For Windsurf default delete -g ApplePressAndHoldEnabled # If necessary, reset global default ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.