Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
10-19-2005, 02:01 PM
|
#1
|
LQ Newbie
Registered: Sep 2005
Location: /bin/vi
Distribution: Fedora, Solaris 8
Posts: 20
Rep:
|
gvim cut/copy-paste keyboard shortcuts
Hi,
suppose i want to copy some text from firefox to gvim, the copied text does not get pasted in gvim with keyboard shortcuts;
i've tried the most-likely shortcuts
Ctrl-V, Shift-Ctrl-V, Shift-Insert
none of them work
when I check the gvim 'Edit' menu, the shortcut for Copy is "+gP ... how the hell am I supposed to remember that--let alone hit 4 keys sequentially---just to Paste from the clipboard?
how do I do a keyboard mapping to Ctrl-V or something sensible
P.S. what were the developers thinking?
Last edited by arunswarup; 10-19-2005 at 02:13 PM.
|
|
|
Click here to see the post LQ members have rated as the most helpful post in this thread.
|
10-19-2005, 02:39 PM
|
#2
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
They were thinking: we want to keep vi the cool, lean
mean editor it always was, and don't annoy the people
who were using it for 20 plus years. Instead of looking
to re-define the thing (always a bad idea, if you get onto
someone elses machine it will "misbehave" again, just
get over it and learn). You COULD conceivably try (I
don't use gvim, just plain vim in an xterm/console) using
X's mouse-way of copying and pasting. High-light in
firefox with the mouse-button1 pressed, switch to gvim,
press i, and middle click into it.
Cheers,
Tink
|
|
|
10-19-2005, 03:04 PM
|
#3
|
LQ Newbie
Registered: Sep 2005
Location: /bin/vi
Distribution: Fedora, Solaris 8
Posts: 20
Original Poster
Rep:
|
customize keyboard shortcut
ok ...
Shift-Insert works on X-term, gnome-terminal, konsole, (even in win XP) ... so, are the shortcut keys dependent on the terminal (in this case gui?)?
how do I set the shortcut key for "paste" to be Ctrl-V?
thank you for replying
edit: if they have a complicated shortcut-setup & expect me to use the mouse (i found the middle-mouse-click quite annoying & i posted in this forum), what is the point of using gvim?
Last edited by arunswarup; 10-19-2005 at 03:07 PM.
|
|
|
10-19-2005, 03:15 PM
|
#4
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
I don't know - that's why I don't use it. But if you
dislike (g)vims key-setup, why don't you use kate
or some other more CUA compliant editor instead
of complaining about a screwdriver not being a
hammer?
Cheers,
Tink
|
|
|
10-19-2005, 03:21 PM
|
#5
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
ok... SO... Ctrl+V for paste is good? Ctrl+X for cut is good? well... they're just arbitrary choices just like vi's are... but what about the generic windows hotkey for copy? Ctrl+C? you honestly think that using exactly the same key combination for "copy the selected text" and "terminate this running process immediately" is a good thing?!?!?!?! cha! DOS was using Ctrl+C to terminate programs long before Notepad and it's ilk came around...
Anywho. vi rocks, and it's not until you take the time to look at it in a little more depth that you have a chance of understanding why.
Last edited by acid_kewpie; 10-19-2005 at 03:22 PM.
|
|
|
10-19-2005, 03:32 PM
|
#6
|
LQ Newbie
Registered: Sep 2005
Location: /bin/vi
Distribution: Fedora, Solaris 8
Posts: 20
Original Poster
Rep:
|
*newbie looks at experienced unix users' posts & thinks!*
ook!
but, they could have assigned something simpler than "+gP
|
|
1 members found this post helpful.
|
10-23-2005, 04:42 PM
|
#7
|
LQ Newbie
Registered: Jul 2005
Distribution: fedora
Posts: 17
Rep:
|
Quote:
Originally posted by arunswarup
*newbie looks at experienced unix users' posts & thinks!*
ook! 
but, they could have assigned something simpler than "+gP
|
add the following to your ~/.vimrc:
Quote:
nmap <C-V> "+gP
imap <C-V> <ESC><C-V>i
vmap <C-C> "+y
|
and don't listen to the conservatives
this assigns Ctrl+V to paste the clipboard in normal and insert modes and Ctrl+c to copy to clipboard in "visual" mode.
|
|
3 members found this post helpful.
|
09-12-2009, 07:34 AM
|
#8
|
LQ Newbie
Registered: Sep 2009
Posts: 2
Rep:
|
Cool! Modifiying the .vimrc works.
Thanks
|
|
1 members found this post helpful.
|
09-12-2009, 01:52 PM
|
#9
|
LQ Newbie
Registered: Jul 2005
Distribution: fedora
Posts: 17
Rep:
|
By the way, there are scripts in the standard distribution that define this and other "compatibility" niceties. If you're used to ms windows "standards" you can add
Code:
source $VIMRUNTIME/mswin.vim
to your ~/.vimrc . For mac compatibility that'd be
Code:
source $VIMRUNTIME/macmap.vim
You can find more interesting standard scripts by browsing the $VIMRUNTIME, just type:
|
|
|
09-13-2009, 10:05 PM
|
#10
|
LQ Newbie
Registered: Sep 2009
Posts: 2
Rep:
|
Thank you so much. I am settling on mswin.vim.
|
|
|
06-01-2012, 07:34 AM
|
#11
|
LQ Newbie
Registered: Feb 2011
Posts: 2
Rep:
|
thnx, though I found that:
nmap <C-V> "+gP
imap <C-V> <ESC><C-V>a
vmap <C-C> "+y
using a (append) instead of i (insert) put my cursor behind what I've pasted worked better for me(even adding a space after a) .
|
|
|
03-08-2014, 10:35 PM
|
#12
|
Member
Registered: Apr 2013
Distribution: DistroWanderer
Posts: 381
Rep: 
|
'<Ctrl - R> +' will paste the X11 buffer. You can just hold Ctrl and Shift then hit 'R' and '+'.
|
|
1 members found this post helpful.
|
07-21-2014, 09:38 PM
|
#13
|
LQ Newbie
Registered: Jul 2014
Posts: 1
Rep: 
|
@ femistofel, YOU ROCK!
checking the contents of the VIMRUNTIME, so I could add some vim and gvim kung fu. Hehehe!
|
|
|
06-29-2016, 09:09 AM
|
#14
|
LQ Newbie
Registered: Jun 2016
Posts: 1
Rep: 
|
modify the .vimrc workd fine
Thanks. I've always desiring to make the paste shortcut "ctrl+v" work since several months. I managed to get the "ctrl+v" work by modifying the file .vimrc.
ps: it is important to stick to the question asked instead of saying some bullshit (like acid_kewpie)
|
|
|
03-05-2022, 12:11 PM
|
#15
|
LQ Newbie
Registered: Mar 2022
Posts: 1
Rep:
|
femistofel post was excellent! Have a look at the scripts - very interesting and just what I needed. Wonder why these are not part of the standard gVim install as suggested / endorsed options? vi is as old as the 80 column IBM punch card and 24 line by 80 character monochrome phosphorus dot CRTs (...in amber if you were really living large!) While still retaining excellent "line oriented" features Vi needs to better integrate the technologies that came after the 70s without selling out its original (high speed/hands on) design philosophy - multiple instances of the same and different programs, whole pages of text, paragraphs (indenting, comment out, etc), easier help maneuvering at high speed inside long lines, mouse/touchpad events, user modifiable quick access tool bar with easily programmed hot keys, gestures, modern local/on-line help system, etc. Above scripts are a great start but more evolution eventually needs to occur.
|
|
|
All times are GMT -5. The time now is 09:46 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|