Search code examples
idesettingsvisual-studio-codevscode-remote

How do I remap the default CTRL+f (find) in Visual Studio Code such that I can use CTRL+f as is typical in unix/linux?


In Visual Studio Code, Ctrl+f activates the Find widget. I use vscode on Windows 10 (ssh into 'nix) and separately on the Ubuntu 18.04 Linux distro (w/Gnome Shell), when using the integrated terminal. I expected Ctrl+f to step one character forward in the CLI, as is typical on many Linux terminals, within vscode. How do I accomplish this?

I'd additionally like to maintain the find functionality, if possible, though with a different binding.

Because my search in SO retrieved little, I'm posting the solution and references I found for the community.


Solution

  • After searching several links via Google, I found straightforward documentation to solve this problem at https://vscode.readthedocs.io/en/latest/editor/integrated-terminal/.

    The solution, in summary:

    1. Open up Preferences: Open Keyboard Shortcuts, e.g. Ctrl+Shift+p and typing keyboard and then enter or return.
    2. Type Ctrl+f in the Keyboard Shortcuts search bar and find the "Terminal: Focus Find Widget" line. Mine looks like this:Terminal Focus Keybinding UI
    3. Click the pencil icon to alter the keybinding. One available for me was Ctrl+Alt+f.

    Note: the following is pasted from the docs for easy reference.

    Or, in your keybindings.json change:

    { "key": "ctrl+f", "command": "-workbench.action.terminal.focusFindWidget",
                          "when": "terminalFocus" },
    

    to something like this:

    { "key": "ctrl+alt+f", "command": "-workbench.action.terminal.focusFindWidget",
                          "when": "terminalFocus" },