Quantcast
Channel: Active questions tagged keymapping - Stack Overflow
Viewing all articles
Browse latest Browse all 74

How to preserve yanked text in buffer after pasting over selection in Visual mode using VSCode Vim extension?

$
0
0

I am using the Vim extension in Visual Studio Code and I'm facing an issue with thebuffer behavior. When I yank some text and then paste it over a selection in visualmode, the yanked text gets replaced in the buffer with the text that wasoverwritten. This is not the behavior I want.

In Neovim, I can use the black hole register to prevent the overwritten text fromreplacing the yanked text in the buffer. The command looks something like this in myNeovim configuration:

vim.api.nvim_set_keymap('v', 'p', '"_dP', {noremap = true})

This command maps p in visual mode to "_dP , which deletes the selected text intothe black hole register and then pastes the yanked text. This way, the yanked textremains in the buffer even after pasting.

I would like to replicate this behavior in Visual Studio Code using the VSCode Vimextension. How can I achieve this? Any help would be greatly appreciated.


Viewing all articles
Browse latest Browse all 74

Trending Articles