8

My fingers are programmed to use ctrl+right arrow to jump a word forward, ctrl+left arrow to jump a word back, in Terminal. I have disabled Mission Control.

I can not figure out how to get this functionality in Visual Studio Code's Integrated Terminal (in macOS obviously). vscode/Code Version 1.27.1.

How do I accomplish this?

1
  • Option+Left/Right is the default way to jump a word backward/forward on macOS. I know it's not what you asked for, but maybe it would be helpful for others like me.
    – bruha
    Mar 30, 2020 at 7:24

2 Answers 2

5

I ended up finding the solution via Microsoft vscode github issues: https://github.com/Microsoft/vscode/issues/64972

Add these keybindings in ~/Library/Application Support/Code/User/keybindings.json

{
    "key": "ctrl+left",
    "command": "workbench.action.terminal.sendSequence",
    "args": { "text": "\u001bb" },
    "when":"terminalFocus"
},
{
    "key": "ctrl+right",
    "command": "workbench.action.terminal.sendSequence",
    "args": { "text": "\u001bf" },
    "when":"terminalFocus"
}

Tested in GNU bash version 4.4.23, (installed via homebrew brew install bash)

1

A totally primitive solution would be to reassign the key's function.

Change the Control to Option as shown.

enter image description here

But that would require you to change it back for other uses.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .