Vscode-neovim: Visual mode mapping not working

Created on 17 Feb 2020  路  4Comments  路  Source: asvetliakov/vscode-neovim

I have the following lines in my init.vim:

    xnoremap <c-c> "+y

which makes "Ctrl-C" in visual mode copy the selected text.

This works in neovim. I added the following to vscode keybindings.json:

    { "key": "ctrl+c", "command": "vscode-neovim.send", "when": "neovim.mode == visual" },

hoping it would send Ctrl-C to neovim and do the copy. However, pressing "Ctrl-C" in visual mode inside vscode has no effect.

Most helpful comment

Thanks a lot! That addresses the issue.

Btw, I got my original settings by clicking "copy" here:
0217-15:37:59

Copying this shortcut does not give me the "args" part so I didn't realize this.

Thanks again for your time

All 4 comments

you need to unbind <C-c> from escape key first - escape keys are treated specially:

                        {
                "command": "-vscode-neovim.escape",
                "key": "ctrl+c",
            },

I do have this already. In fact I also tried <C-a> and got the same outcome.

Ah, you forgot "args": "<C-c>" in your vscode-neovim.send keybinding

Thanks a lot! That addresses the issue.

Btw, I got my original settings by clicking "copy" here:
0217-15:37:59

Copying this shortcut does not give me the "args" part so I didn't realize this.

Thanks again for your time

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DrakeXiang picture DrakeXiang  路  5Comments

trkoch picture trkoch  路  3Comments

Liquidmantis picture Liquidmantis  路  3Comments

pieterdd picture pieterdd  路  4Comments

anhyeast picture anhyeast  路  5Comments