Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to copy/paste some text to vim from gedit. The original text looks like this:

copy from gedit

I start vim, press "i", then right click, paste, and get this:

pasted to vim

How could i set vim to not to do this? How can I copy/paste my text so that I don't need to delete those unnecessary tabs?

share|improve this question
up vote 2 down vote accepted

Take a look here. Basically it's the pastetoggle option.

share|improve this answer
wow, thanks! This one really works under Fedora 14. But when i want to try it on openwrt i press F2, and it inserts a "Q" rather then going to paste mode. what hotkey is working under openwrt? – LanceBaynes Mar 7 '11 at 9:50
@user62367, that's strange... Alternatively you can use, in normal mode the commands :set paste and :set nopaste. – Mr Shunz Mar 7 '11 at 10:55
i tried it, but it didn't work under openwrt 10.03 vim - 7.1-3 :\ but thank you!! – LanceBaynes Mar 7 '11 at 14:52

It may be that your vim is not aware of the X11 clipboard or cutbuffer. Instead of running vim at the command line, run gvim -v instead. That will give you a terminal Vim, but with the X11 features enabled. Then pasting with the mouse, e.g. using the middle mouse button, should just work.

If that works, then you can add

alias vim='gvim -v'

to your ~/.bashrc file to use gvim when you execute vim.

Vim can be built with full support for X11 and the mouse, but many distributions don't do that.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .