0

The vim binary shipped with the git for windows package has integration with OS clipboard enabled and I hate it. So many times I attempt to replace a word with something from the clipboard with cw + shiftinsert, only to be frustrated because the cw command ruined the clipboard by overwriting with the thing I wanted to replace.

So how do I disable this completely and forever, so that vim never ever interacts with the OS clipboard?

3
  • Have you tried set clipboard="" in your vimrc? :h g:clipboard
    – statox
    Feb 23, 2021 at 14:33
  • @statox Make your comment into an answer, it worked (although there is no g:clipboard help entry).
    – hlovdal
    Feb 23, 2021 at 14:49
  • My bad I used the wrong topic and I didn't realize because :h g:clipboard exists in neovim but not in vim.
    – statox
    Feb 23, 2021 at 15:06

1 Answer 1

1

See the doc for :h 'clipboard' it is used to tell to vim to use different system clipboards or none of them. (The behavior is a bit different between vim and neovim).

In your case you want to use no clipboard so put that in your vimrc:

set clipboard=""

As Ben pointed out in the comments the "" is not necessary you can write only set clipboard=

1
  • 1
    @D.BenKnoble you're right but I never got used to this syntax, having nothing after a = still makes me uncomfortable :)
    – statox
    Feb 23, 2021 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.