How to make ctrl+right/left arrow jump words in Visual Studio Code

shortcutvisual-studio-code

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?

Best Answer

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" }
},
{
    "key": "ctrl+right",
    "command": "workbench.action.terminal.sendSequence",
    "args": { "text": "\u001bf" }
}

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