3 ms·
The bounce indenter in Steve Yegge's js2-mode is an interesting approach: For any given line, there are some obvious possible indentation points: - wha
by bazzargh 13y ago
The bounce indenter in Steve Yegge's js2-mode is an interesting approach:
For any given line, there are some obvious possible indentation points:
- whatever position Karl's guesser wants to use
- the beginning of the line
- after the '=' if the previous line is an assignment
- same indentation as the previous line
- first preceding line with less indentation than the preceding line
[...]the TAB key cycles among them.
http://steve-yegge.blogspot.co.nz/2008_03_01_archive.html http://steve-yegge.blogspot.co.nz/2008_03_01_archive.html
It takes a lot of the frustration out of the indenter getting it wrong; in practice this doesn't cycle around tab points as much as you'd think.
And then there's cc-guess.el, which guesses your preferred indentation style by examining the current file. It would be soooooo nice if these ideas were available across all modes.