You are not logged in.
I am trying to yank text from vim to the clipboard. I am trying to use "*yy and "+yy. These commands allow me to paste the text inside of vim, but nothing gets written to the system clipboard. Curiously, I also don't see any feedback from vim when I yank. I vaguely remember that vim used to give some message like "X linex yanked to register *" (but I'm not too sure about this). I can also copy and paste in Geany and rxvt-unicode, which *do* seem to use the system buffer.
I use the X window system, rxvt-unicode, and the zsh shell. In my .Xdefaults I have (leaving out irrelevant configuration such as colors):
URxvt.iso14755: false
URxvt.iso14755_52: false
! Disable Ctrl-Alt-c & Ctrl-Alt-v bindings
URxvt.keysymb.C-M-c: builtin-string:
URxvt.keysymb.C-M-v: builtin-string:
! Bind Ctrl-Shift-c & Ctrl-Shift-v to copy and paste
URxvt.keysym.C-S-0x43: eval:selection_to_clipboard
URxvt.keysym.C-S-0x56: eval:paste_clipboardMy .vimrc looks like
set number
set tabstop=4
tab all
syntax on
set wrap!
set shortmess-atII think overriding control+shift+c and control+shift+v may cause the problem. I can use control+shift+c and control+shift+v in vim as well. I would be happy to use those, but the problem is that shift+control+c copies line numbers as well.
Vim doesn't support system clipboard, you can use xclip with visual mode for copy to system clipboard
vnoremap <C-c> y: call system("xclip -i", getreg("\""))<CR>
noremap <C-V> :r !xclip -o <CR>or
you can use gvim
Last edited by Docbroke (2018-06-02 13:51:33)
Arch is home!
https://github.com/Docbroke
Offline
To support the clipboard register " in the terminal, you need to install vim-fakeclip from the AUR.
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline
Vim doesn't support system clipboard, you can use xclip with visual mode for copy to system clipboard
vnoremap <C-c> y: call system("xclip -i", getreg("\""))<CR> noremap <C-V> :r !xclip -o <CR>or
you can use gvim
I couldn't get xclip to work for me - to access the system clipboard I seem to have to use the -selection clipboard option - but somehow I still couldn't manage to paste the text outside of vim. Gvim works like a charm ![]()
To support the clipboard register " in the terminal, you need to install vim-fakeclip from the AUR.
For some reason, vim-fakeclip doesn't work for me. Again, yanking works fine inside vim, but the system clipboard is not affected. However, installing gvim (and using the normal vim) works like a charm for me.
Thanks for the replies!