Vim: Enough tabs already

Scenario:

You are connected to a Linux webserver via a Windows terminal client such as PuTTy. You copy some text to paste into a Vim document open on the remote machine and you get tab hell:

Here’s an example of something I pasted in tonight:

[code]
ServerAdmin webmaster@host.some_domain.com
DocumentRoot /home/bealers/www
ServerName bealers.com
ErrorLog /var/log/apache/bealers.com-error.log
CustomLog /var/log/apache/bealers.com-access.log common

Options Indexes

[/code]

To fix this globally you can edit, as root, /etc/vim/vimrc (or similar) so that this line is commented out, or add it if not there:
[code]set autoindent[/code]

else edit your vimrc file ~/.vimrc

Related:
http://www.vim.org/tips/tip.php?tip_id=330


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *