Vim

From TheBeard Science Project Wiki
Jump to: navigation, search

Disable All Auto-Formatting

Vim has really taken a turn for the worst in some distros. It's supposed to be a tool with maximum utility, but instead it automatically inserts garbage, by default, when you don't want it! Why would I want automatic commenting? Is it too much trouble to type a comment? I'll tell you what's too much trouble, when you paste a block of code and it all gets automatically commented, and automatically indented beyond recognition. I spend more time mending the damage done by vim than actually writing code. Is this just the default in Ubuntu Server, or Debian? I don't care. Whoever is responsible for this ... well, here's how to disable EVERYTHING!

(I will continue to add more as I discover it)

Disable auto-indent:

cd /usr/share/vim/vim80
sudo mv indent.vim indent.vim.bak

Disable auto-commenting:

(replace the path to vimrc file with the correct path for your distro)

echo "autocmd BufNewFile,BufRead * setlocal formatoptions-=cro" >> /etc/vim/vimrc