在 WSL@Windows 10 上使用 Cv 无法在 Vim 中使用可视块模式

lnk*_*nk3 14 vim copy-paste windows-subsystem-for-linux windows-terminal

我在新的 Windows 终端中使用 WSL Ubuntu 和 Vim,但是如果我必须使用 Cv进入视觉块模式,我不能,因为它充当粘贴。

我可以将它重新绑定到其他东西,但我没有找到我必须添加的命令.vimrc,我认为它与inoremap 有关

有什么建议吗?

And*_*dus 18

CTRL+v is bound to paste in Windows Terminal by default. As of now, the only thing that's working is to disable that behaviour in the settings.json. You can do that by pressing CTRL+, or select Settings in this menu and commenting out the line:

  "keybindings": [
    ...
    // { "command": "paste", "keys": "ctrl+v" }, <------ THIS LINE
Run Code Online (Sandbox Code Playgroud)

After doing this, you can switch to visual block mode as usual and paste with CTRL+SHIFT+v.

I've found these issues on the project's GitHub about this problem:

https://github.com/microsoft/terminal/issues/5790

https://github.com/microsoft/terminal/issues/5641

  • 这就像一个魅力,你甚至不需要重新启动终端会话 (4认同)
  • @JamesM.Lay 如果你放弃“sual Studio”部分,我确信等待时间会减少;) (3认同)

小智 5

您只需更改默认的“settings.json”即可

原文:

{
    "command": 
    {
        "action": "copy",
        "singleLine": false
    },
    "keys": "ctrl+c" 
},
{
    "command": "paste",
    "keys": "ctrl+v"
},
Run Code Online (Sandbox Code Playgroud)

修改的 :

{
    "command": 
    {
        "action": "copy",
        "singleLine": false
    },
    "keys": "ctrl+shift+c"
},
{
    "command": "paste",
    "keys": "ctrl+shift+v"
},
Run Code Online (Sandbox Code Playgroud)


小智 5

尝试Ctrl-q使用 VISUAL BLOCK 模式。