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? |
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 |
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? |
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 |
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. |
*newbie looks at experienced unix users' posts & thinks!*
ook! :D :) but, they could have assigned something simpler than "+gP |
Quote:
Quote:
this assigns Ctrl+V to paste the clipboard in normal and insert modes and Ctrl+c to copy to clipboard in "visual" mode. |
Cool! Modifiying the .vimrc works.
Thanks |
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 Code:
source $VIMRUNTIME/macmap.vim Code:
:vi $VIMRUNTIME |
Thank you so much. I am settling on mswin.vim.
|
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) . |
'<Ctrl - R> +' will paste the X11 buffer. You can just hold Ctrl and Shift then hit 'R' and '+'.
|
@ femistofel, YOU ROCK!
checking the contents of the VIMRUNTIME, so I could add some vim and gvim kung fu. Hehehe! |
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) |
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:36 PM. |