amix / vimrc

The ultimate Vim configuration (vimrc)
MIT License
30.78k stars 7.3k forks source link

Enter visual block mode with ctrl+v #732

Closed SamuelBailey closed 1 year ago

SamuelBailey commented 1 year ago

When I press ctrl+v, vim pastes the contents of my system clipboard, rather than entering visual block mode. It doesn't matter if I'm in insert or command mode when I press ctrl+v. How can I configure vim to allow me to enter visual block mode instead?

This question was asked before here: https://github.com/amix/vimrc/issues/461 but it was closed with no answer.

SamuelBailey commented 1 year ago

I found this was an issue with using windows terminal for WSL. Windows maps paste to Ctrl-V which overrides the setting that vim uses. My solution was commenting out the following lines in the json under the "interaction" section of windows terminal settings.

{
    "command": {
        "action": "copy",
        "singleLine": false
    },
    "keys": "ctrl+c"
},
{
    "command": "paste",
    "keys": "ctrl+v"
}

As described in this stack overflow post: https://stackoverflow.com/questions/426896/vim-ctrl-v-conflict-with-windows-paste/65109836#65109836