How can I copy text from Gedit?

Formatting gets changed when trying to copy text from gedit to vim

  • I want to copy/paste some text to vim from gedit. The original text looks like this: I start vim, press "i", then right click, paste, and get this: 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?

  • Answer:

    Take a look http://vim.wikia.com/wiki/Toggle_auto-indenting_for_code_paste. Basically it's the pastetoggle option.

LanceBaynes at Super User Visit the source

Was this solution helpful to you?

Other answers

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.

garyjohn

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.