How do I paste into Vim
Just getting used to Vim (please don't start the Vim vs Emacs thing, I've tried both and made my choice :-) )
How do I paste into Vim if I've copied from elsewhere? this only came to light when I wanted to paste some source code from Firefox into Vim and I just can't do it. Is there something that I am missing or isn't it possible. Thanks Eric |
It likely depends on the virtual terminal app you're using.
For example: I believe a default gnome-terminal configuration will paste with the Ctrl+Shift+V key combo. (Don't forget to enter editing mode and position your cursor in vim first...) |
Always try right-clicking. I have discovered all manner of things by doing this. In Konsole, eg, there is copy and paste, plus several other things including the configuration menu.
|
In konsole 'paste' is assigned the following keys Shiff+Ctrl+insert
|
Thanks for the quick replies.
ctrl + shift + v pastes into the terminal but chops off the first letter which is odd. I can paste into GVim selecting from the menu but what on earth does the keybinding "+gP mean! |
Hi blastradius,
before pasting with shift+ctrl+v you'll have to enter the insert-mode in vim (press for example the i- or a-character). Otherwise the text will be inserted beginning with the first character which enters the insert mode. Markus |
To copy/cut paste in vim you user delete, yank, and paste. The vim wiki has instructions for doing this at http://vim.wikia.com/wiki/Copy,_cut_and_paste. The Ctrl functions used in many text editors will not always work in vi(m). But delete, yank, and paste will always work--so this is the best way to learn (and get in the habit) of doing when in vi(m).
|
I can't stand Vim ... completely crazy idea for an editor .. IMHO Sry, just needed to rant.
|
You can't use the yank etc cmds if you're copying from an external src as per OP.
In FF, use highlight+Ctrl-C to copy, the move mouse to vim editor, press 'i' to go into insert mode (or <esc>i to make sure you are in right mode), then right-click to paste. If right-click has issues, try the paste option from whatever terminal menu is avail |
why nobody likes nano? :scratch:
|
I love nano---and my name is not "nobody"........;)
|
Also... if you are pasting into Vim from an outside source you might get odd tabbing behavior. To fix this turn on paste mode (set paste / set nopaste).
Quote:
|
Thank you everybody, my question is now fully answered.
For the record one of the reasons I've chosen Vim is the community out there, I posted a question at 7:02pm, got my first response at 7:09 and have just read replies which came in overnight (in the UK that is). This many people using a piece of software can't be wrong! I found I was distracted with other software (too many bells and whistles and things to fiddle with), Vim edits and it does it extremely well. Thanks again. God knows why I didn't pick up on not being in insert mode when pasting in the terminal (probably because I had no problem pasting into Gvim), thanks to Markush for that one. |
If you work in the *nix world, the one editor you can guarantee to be avail on HP-UX, Solaris, Linux (any), *BSD is vi ... and vim is just Vi Improved :)
Most commercial servers don't have a GUI either, so you need to know a cli editor ie vi . |
All times are GMT -5. The time now is 04:31 AM. |