I am using Linux OS. I would like to copy some text in visual mode from Vim to system clipboard and then paste it in another shell. I tried the following :
In the .vimrc file inside /home/{USER} directory put the following :
vmap <C-c> "*y
After this I exited the shell and then opened a new shell and a file in vim. Did Visual selection and then issued *y. It yanked the lines selected. I exited vim and then in the shell issued CTRL+SHIFT+V . But nothing happens.
I tried setting the following also in .vimrc file :
set clipboard=unnamed
But this also doesn't work.
P.S: I am able to paste from system clipboard to vim using *p
.
What can be the problem here? Am I setting the options in the wrong .vimrc file?
Edit: When I did vim --version|grep clipboard I see the following:
[subhrcho@slc04lyo ~]$ vim --version|grep clipboard
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
-xterm_clipboard -xterm_save
~/.vimrc
. Try"+y
and"+p
instead.*p
works for me already.vim --version | grep clipboard
say?