Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
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.
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.
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.
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!
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.
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).
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
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:
Originally Posted by karlochacon
why nobody likes nano?
While I'm sure somebody likes nano, I don't like text editors that can mangle your file with their default wrap behavior...
Last edited by jtshaw; 11-11-2009 at 10:19 PM.
Reason: Added paste on/off commands...
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 .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.