Red Hat Bugzilla – Bug 76263
Default auto-indent/comment makes copy&paste nearly useless
Last modified: 2007-04-18 12:47:44 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020513
Description of problem:
The auto-indent/comment modes of VIM runs even when you try to paste in text
from another window. It effectively makes pasting completely unusable.
Please make VIM auto-indent/comment modes disabled by default. It makes the
intuitive use of "vi" not behave as one would expect. "vi" should be a pure
text editor and not do strange things to text you paste in.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Start VIM on C source file in an Xterm window.
2. Try to paste in a C structure initializer, section of source code, or comment
with your mouse.
3. Note that the indenting/comments are now screwed up.
Expected Results: I expected it to paste EXACTLY as it was in the other VIM window.
I just took over this package, so I'm not sure about the changes between the
last release and this one. It seems that vi is now an alias to vim, which
has cindent enabled.
I'd like to keep it this way as it is a lot easier for newbies to use.
If you don't like it, you have several options:
- remove the alias from /etc/profile.d/vim.* (affects all users)
- set an alias vi=/bin/vi in your ~/.bashrc
- disable cident before pasting code
or (which is what I usually do):
- paste the code, mark the new code with Shift-v and press = to reindent
This works quite well for me and the code is properly indented afterwards
even if it hasn't been before.