Difference between revisions of "Vim"

From TheBeard Science Project Wiki
Jump to: navigation, search
(Created page with " == Disable Auto-Indent == <source> cd /usr/share/vim/vim80 sudo mv indent.vim indent.vim.bak </source>")
 
(Disable All Auto-Formatting)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
  
== Disable Auto-Indent ==
+
== 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)
 +
 +
<b>Disable auto-indent:</b>
 
<source>
 
<source>
 
cd /usr/share/vim/vim80
 
cd /usr/share/vim/vim80
 
sudo mv indent.vim indent.vim.bak
 
sudo mv indent.vim indent.vim.bak
 +
</source>
 +
 +
<b>Disable auto-commenting:</b>
 +
 +
(replace the path to vimrc file with the correct path for your distro)
 +
<source>
 +
echo "autocmd BufNewFile,BufRead * setlocal formatoptions-=cro" >> /etc/vim/vimrc
 
</source>
 
</source>

Latest revision as of 01:15, 13 June 2019

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