Disabling autoindent in vim when pasting new text
In this days, vim, at least on debian, has changed a lot of annoying defaults.
One of these is the automatic indentation when pasting text, which involves a continuous increase of the spaces at the beginning of every line.
Disabling the autoindent (:set noai
) does not work, and only today I managed to find the key thanks to an article on stackoveflow: just use the command :set paste
to disable the auto indent, and eventually re-enable it with :set nopaste
after the paste.
With :set pastetoggle=<F3>
it is possible to use the F3 key to alterntatively enable and disable the paste mode, even while editing text.