Vim copying to clipboard not working (.vimrc in place)

I have in my ~/.vimrc the following:

"Import defaults.vim from /usr/share/vim/[VIM_VERSION]/
scriptencoding utf-8
if filereadable(expand(’$VIMRUNTIME/defaults.vim’))
unlet! g:skip_defaults_vim
source $VIMRUNTIME/defaults.vim
endif

"Config keyshorts for copy and paste
noremap <C-S-c> "+y
noremap <C-S-v> "+p
noremap y "+y
noremap p "+p

the "+y seems map right but is is not going to the clipboard

I have Gvim installed but still copying from vim to clipboard is not working, who has an idea?

have you tried :set clipboard=unamedplus ?

i tried: “:set clipboard=unnamedplus”, no effect

i also tried: “set clipboard^=unnamed,unnamedplus”
https://stackoverflow.com/questions/30691466/what-is-difference-between-vims-clipboard-unnamed-and-unnamedplus-settings

Hello,

What version of vim do you have ??
Open vim and check if its compiled with +clipboard option, :version and press enter.
I also have the setting that @gandalf mentioned and it works.

[EDIT]
If you have +clipboard then try without

Open blank .vimrc and write these

" For Vim iMproved
set nocompatible

" For encoding
" The encoding displayed.
set encoding=utf-8

" The encoding written to file.
set fileencoding=utf-8

" For global file formatting
set fileformats=unix

" Set copy and paste from/to vim, e.g vim --> browser, browser --> vim
set clipboard=unnamedplus

" Set backspace key to delete lines
set backspace=indent,eol,start

[EDIT 2] :slight_smile: Sorry about this

Am when you set clipboard=unnamedplus you no longer need this

You just use regular y and p for copying and pasting
Ex. You copy from browser with Ctrl + c you paste in vim with p or P
and vice versa.

tried this with vim and gvim, and no luck.

should i do this with vim or gvim? if i manually do "+ it also does not work

copying from browser to vim works, its the other way around that doe not work

For me it works in both.

Copy with y or Y and in browser paste with Ctrl + v it must work…
I can’t think of a reason why it would not. :man_shrugging:

Try disabling plugins if you have any and see if that changes anything…

[EDIT]
You should only have one .vimrc it works for vim and gVim.

It worked in the past, but now it stop working after a reinstall of manjaro

I installed linux mx and not its all working

Hello,

Tnx for marking my answer as solution. I think it should also work under manjaro as well.
Maybe reinstall of vim and gVim could have been the answer.

Thanks nevertheless…

Cheers…

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.