Copying and pasting to and from other programs

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Copying and pasting to and from other programs

Jorge Timón
Hi, as the title says, I want to Copy and paste to and from other
programs, obviously, in vim.
I've tried this, but it's not working as I expected:

vnoremap <C-c> y
vnoremap <C-v> p
nnoremap <C-v> ip
map! <C-c> y
map! <C-v> p

My OS is ubuntu, just in case it matters.

Thank you

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Copying and pasting to and from other programs

Benjamin Esham
Jorge Timón wrote:

> Hi, as the title says, I want to Copy and paste to and from other
> programs, obviously, in vim.
> I've tried this, but it's not working as I expected:
>
> vnoremap <C-c> y
> vnoremap <C-v> p
> nnoremap <C-v> ip
> map! <C-c> y
> map! <C-v> p
>
> My OS is ubuntu, just in case it matters.

Hi Jorge,

I’m not that familiar with running Vim on Linux, but take a look at

  :help "*
  :help 'clipboard'

I think you probably want e.g.

  vnoremap <C-c> "*y

HTH,
--
Benjamin D. Esham   |   [hidden email]
“scientologists... combining everything i hate about religion
with everything i hate about intellectual property laws.”
                                 — circletimessquare on kuro5hin

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Copying and pasting to and from other programs

Albie Janse van Rensburg
In reply to this post by Jorge Timón
Jorge Timón wrote on 22/07/2010 07:56 PM:

> Hi, as the title says, I want to Copy and paste to and from other
> programs, obviously, in vim.
> I've tried this, but it's not working as I expected:
>
> vnoremap <C-c> y
> vnoremap <C-v> p
> nnoremap <C-v> ip
> map! <C-c> y
> map! <C-v> p
>
> My OS is ubuntu, just in case it matters.
>
> Thank you
>  
The quickest way to get to your stated goal: :help mswin.vim

or you could do it yourself by mapping <C-C> to "+y; <C-V> to "+p; etc

I recommend learning the "Vim way", that is "<register>y and
"<register>p, etc - you become much more flexible in vim. This is
especially true for X-windows, as you have 2 different "global"
copy/paste registers:
 - the "+" register: this is where stuff goes when you select "copy" in
most programs
 - the "*" register: this is where your "selection copy" goes

By the way, it's not such a great idea to remap <c-c>, <c-x> and <c-v>,
those key combinations actually do something in Vim, and you'll be
restricting yourself a bit.

Cheers,
Albie

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php