How about making 'indentexpr' for Vim file types escape indenting after an "augroup" definition?

25 views
Skip to first unread message

Bohr Shaw

unread,
Jan 12, 2014, 7:21:41 AM1/12/14
to vim...@googlegroups.com
Sometimes I define an "augroup" at a file beginning and END it at the file end. Thus, with the default 'indentexpr' settings, I would indent almost the whole files one more level, which is not expected.

And because that arbitrary commands can come after an "augroup" definition and there not necessarily have to be a corresponding ":augroup END". So I doubt if indenting after an "augroup" definition is a sensible default. How do you think about this? (Hope my English is understandable.)

Gary Johnson

unread,
Jan 12, 2014, 2:19:53 PM1/12/14
to vim...@googlegroups.com
I doubt that most people would want this.

You can change this for yourself by copying
$VIMRUNTIME/indent/vim.vim to ~/.vim/indent/vim.vim, deleting lines
61 and 62, and at 89, deleting the pattern

\|aug\%[roup]\s*!\=\s\+END

Regards,
Gary

Bohr Shaw

unread,
Jan 12, 2014, 7:43:20 PM1/12/14
to vim...@googlegroups.com
Most of the time we define auto-commands in a central place grouped by an "augroup" definition.
I guess few people would define auto-commands belonging a group across a whole file.

So the default indenting is based on the common usage, not strictly on the syntax.
It's "indenting on the intended syntax".

If so, I think I would just avoid indenting on the whole file(actually the only file).



--
--
You received this message from the "vim_dev" 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

---
You received this message because you are subscribed to a topic in the Google Groups "vim_dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_dev/lkJF1ndR8EI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Regards, Bohr Shaw
Reply all
Reply to author
Forward
0 new messages