I use WSL Ubuntu and Vim inside the new Windows Terminal, but if I have to enter the visual-block mode with C-v, I can't since it acts as paste.
I am okay with rebinding it to something else but I don't happen to have found the command that I have to add to .vimrc
, I think it has something to do with inoremap.
Any advice?
To enable the Visual block mode in Vim, you have to try out the “Ctrl+V” command within the normal mode.
In that case, I had to get used to use right click as copy and paste, also change the default property of the WSL terminal to use Ctrl+Shift+C and Ctrl+Shift+V as the key combo to copy paste. As a Python developer, I copy and paste code into Vim quite a lot.
Ensure that you have the Windows Subsystem for Linux enabled, and that you're using Windows Build version 18362 or later. To enable WSL run this command in a PowerShell prompt with admin privileges: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux .
To start using WSL, open up a PowerShell terminal and type wsl . If you've set up WSL correctly, you'll enter a bash terminal running on the WSL distro of choice. From here, you can run any Linux commands you wish. Below you will find a reference to all of the options the wsl.exe provides when starting up.
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
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
You can just change the default "settings.json"
Orignal :
{
"command":
{
"action": "copy",
"singleLine": false
},
"keys": "ctrl+c"
},
{
"command": "paste",
"keys": "ctrl+v"
},
Modified :
{
"command":
{
"action": "copy",
"singleLine": false
},
"keys": "ctrl+shift+c"
},
{
"command": "paste",
"keys": "ctrl+shift+v"
},
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With