yes, install xclip and put the 2 lines

vmap <C-c> y:call system("xclip -i", getreg("\""))<CR>
nmap <C-i> :call setreg("\"",system("xclip -o"))<CR>p

in your .vimrc. Of course this will work only if you run X server.

then when you select text by mouse (in case if mouse=a) or by entering
visual mode from keyboard, and then Ctrl-c - the text will be copied
to system clipboard and you can paste it anywhere. In normal mode Ctrl-
i will insert text in vim from system clipboard.

Best regards. Alexey.

On 14 янв, 01:05, r <[email protected]> wrote:
> On 13 Gen, 22:20, Alexey Radkov <[email protected]> wrote:
>
>
>
> > Even better:
>
> > vmap <C-c> y:call system("xclip -i", getreg("\""))<CR>
> > nmap <C-i> :call setreg("\"",system("xclip -o"))<CR>p
>
> > On 13 янв, 23:51, Alexey Radkov <[email protected]> wrote:
>
> > > I use
>
> > > " system clipboard copy-paste (copy in visual mode, paste in normal)
> > > vmap <C-c> y:call system("xclip -i -selection clipboard", getreg("\""))
> > > <CR>:call system("xclip -i", getreg("\""))<CR>
> > > "nmap <C-i> :call setreg("\"",system("xclip -o -selection clipboard"))
> > > <CR>p
>
> > > and it works (just pasted this from vim). You have to install xclip
> > > package (I found it in my Fedora repository).
> > > How it works: select text and then Ctrl-c - selection disappears and
> > > you can paste it anywhere by clicking the center mouse button (or how
> > > your system configured).
> > > I commented out Ctrl-i because it was not necessary to paste from-to
> > > this way (Shift-insert works nice in this direction) and it did not
> > > worked well.
>
> > > Best regards. Alexey.
>
> Alexey exactly what have I to do, install xclip and then paste this
> two lines inside vim or in consolle prompt
>
> vmap <C-c> y:call system("xclip -i", getreg("\""))<CR>
> nmap <C-i> :call setreg("\"",system("xclip -o"))<CR>p
>
> or
>
> vmap <C-c> y:call system("xclip -i -selection clipboard", getreg
> ("\""))
> <CR>:call system("xclip -i", getreg("\""))<CR>
> nmap <C-i> :call setreg("\"",system("xclip -o -selection clipboard"))
> <CR>p
>
> ?
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to