Many times I had the autoindent issue when I paste text into vim in a terminal or a putty window. each line of the text used to indent at increasing levels. That annoyed me much especially whenever I paste too many lines. I used to work around it by disabling the auto indent (:set noai) before pasting and enabling it later. Now I found a much easier way than this.
:set pastetoggle=<F3>
The key to pastetoggle need not be F3. can be any key. Just press F3 before pasting (either in COMMAND mode or INSERT mode) and the pasted content won't be autoindented. Press F3 again to toggle back to normal. To keep this key persistent, add it to your vimrc file in your $HOME directory.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment