On Tue, 5 Oct 2010, Ryan Williams wrote:


On Tue, Oct 5, 2010 at 1:17 AM, Alexander Dietz wrote:


autocmd BufEnter * set ai sw=4 ts=4 sta et fo=croql



This was confusing for me to read, you may find parsing your .vimrc easier if you convert

autocmd BufEnter * set ai

into

set ai

or even (my favorite)

set autoindent


This way it's easier to actually understand what your .vimrc is doing. I think these three directives are equivalent but someone more qualified than me can correct me if there are differences between them.

With the autocommand version, the options get set whenever changing to a different buffer. If a modeline turns off 'autoindent', it will be turned back on. If a modeline sets its own 'formatoptions', the autocmd resets it.

So, there's a difference. Personally, I thought these lines were weirder:

autocmd FileType * set tabstop=2|set shiftwidth=2|set noexpandtab
autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab

(Why not combine the 'bar'-delimited ':set' commands?) But either way, it works the same. Just for reference, fully "compressed":

au FileType * se ts=2 sw=2 noet
au FileType python se ts=4 sw=4 et

--
Best,
Ben

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to