Vim: Change handleKeys to take a `mode`

Created on 7 Oct 2017  路  1Comment  路  Source: VSCodeVim/Vim

  • Click thumbs-up 馃憤 on this issue if you want it!
  • Click confused 馃槙 on this issue if not having it makes VSCodeVim unusable.

The VSCodeVim team prioritizes issues based on reaction count.


Is this a BUG REPORT or FEATURE REQUEST?: Feature request

Changing handleKeys to take a mode (INSERT, NORMAL, VISUAL, etc) would allow greater customization and control over when vsc or vim should handle key events.

See #2056 as an example.

In normal mode pressing \


Note: The behavior of \db are slightly different. I can elaborate more if necessary.

kinfeature

Most helpful comment

Adding the following to keybindings.json worked for me to map C-w to 'close window' in Normal mode and 'delete a word backwards' in Insert mode.

{
    "key": "ctrl+w",
    "command": "-extension.vim_ctrl+w",
    "when": "editorTextFocus && vim.active && vim.use<C-w> && !inDebugRepl"
}
{
    "key": "ctrl+w",
    "command": "extension.vim_ctrl+w",
    "when": "editorTextFocus && vim.active && vim.use<C-w> && vim.mode == 'Insert' && !inDebugRepl"
}

>All comments

Adding the following to keybindings.json worked for me to map C-w to 'close window' in Normal mode and 'delete a word backwards' in Insert mode.

{
    "key": "ctrl+w",
    "command": "-extension.vim_ctrl+w",
    "when": "editorTextFocus && vim.active && vim.use<C-w> && !inDebugRepl"
}
{
    "key": "ctrl+w",
    "command": "extension.vim_ctrl+w",
    "when": "editorTextFocus && vim.active && vim.use<C-w> && vim.mode == 'Insert' && !inDebugRepl"
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

orn688 picture orn688  路  3Comments

WangRongda picture WangRongda  路  3Comments

liamdawson picture liamdawson  路  3Comments

typeoneerror picture typeoneerror  路  3Comments

triztian picture triztian  路  3Comments