Mapping keys in gvim

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

Mapping keys in gvim

Nelson Benítez
Hi,
I've recently begin using gvim as a replacement to gedit, but I would
like to have gvim use the normal shortcuts (CTRL-C , CTRL-X , CTRL-V)
for copy, cut and pate, respectively...

I've looked in http://vimdoc.sourceforge.net/vimfaq.html#20.1 ,
but I can't see what are the commands for copy, cut, paste so I can put
them in a :map statement... So I would appreciate any command/comment on
how to achieve this.

Thanks in advance
Reply | Threaded
Open this post in threaded view
|

Re: Mapping keys in gvim

Dominic Evans
Add to top of your _vimrc

if has("win32")
  source $VIMRUNTIME/mswin.vim
  behave mswin
endif

these bindings are already done for you :)

Cheers,
Dom

On 11/09/05, Nelson Benítez <[hidden email]> wrote:

> Hi,
> I've recently begin using gvim as a replacement to gedit, but I would
> like to have gvim use the normal shortcuts (CTRL-C , CTRL-X , CTRL-V)
> for copy, cut and pate, respectively...
>
> I've looked in http://vimdoc.sourceforge.net/vimfaq.html#20.1 ,
> but I can't see what are the commands for copy, cut, paste so I can put
> them in a :map statement... So I would appreciate any command/comment on
> how to achieve this.
>
> Thanks in advance
>
Reply | Threaded
Open this post in threaded view
|

Re: Mapping keys in gvim

Nelson Benítez
Dominic Evans wrote:
> Add to top of your _vimrc
>
> if has("win32")
>   source $VIMRUNTIME/mswin.vim
>   behave mswin
> endif
>
> these bindings are already done for you :)

But I'm on linux, will that work in linux ?
Reply | Threaded
Open this post in threaded view
|

Re: Mapping keys in gvim

A.J.Mechelynck
In reply to this post by Nelson Benítez
----- Original Message -----
From: "Nelson Ben?tez" <[hidden email]>
To: <[hidden email]>
Sent: Sunday, September 11, 2005 7:02 PM
Subject: Mapping keys in gvim


> Hi,
> I've recently begin using gvim as a replacement to gedit, but I would
> like to have gvim use the normal shortcuts (CTRL-C , CTRL-X , CTRL-V)
> for copy, cut and pate, respectively...
>
> I've looked in http://vimdoc.sourceforge.net/vimfaq.html#20.1 ,
> but I can't see what are the commands for copy, cut, paste so I can put
> them in a :map statement... So I would appreciate any command/comment on
> how to achieve this.
>
> Thanks in advance

Warning: On Unix, "* and "+ are different. On other systems (such as mine),
they are synonymous and both mean the clipboard. You may or may not have to
replace * by + everywhere below.

Copy visual selection to clipboard
    "*y

Cut visual selection to clipboard
    "*d

Paste clipboard before cursor
    "*P

Paste clipboard after cursor
    "*p

Replace visual selection by clipboard contents
    c^R*

(where ^R means "hit Ctrl-R")

The above are for Normal mode. For Insert/Replace mode, prefix each of them
by Ctrl-O. To paste the clipboard in Insert mode, you can also use Ctrl-R *


Rather than _mapping_ them, I recommend _using_ them (and other Vim commands
too). YM, however, MV.

Best regards,
Tony.