6 ms·
Wouldn't it be nice if all languages made indentation significant? Or at least included a tool to fix it.
by tiglionabbit 10y ago
Wouldn't it be nice if all languages made indentation significant?
Or at least included a tool to fix it.
- wcarron 10y agoVim has a nice command to fix indentation from the beginning to end of file: "gg==G (include the dblquotes)
- reitanqild 10y agoJust don't uncritically apply this to all files without thinking twice and also consult with your team. :-/
- rifung 10y ago(Assuming that vim knows how to indent the language you're editing and in the way that you want)
- throwanem 10y agoEmacs does the same with C-x h TAB, or you can mark a region manually and reindent its contents with TAB. As with vim, this depends on being in the right major mode for the language you're working with, which should be automatic for most languages (except Perl, which is screwy, because of course it is), and depends also on that major mode knowing how to cope with the code and being configured the way you want, which should be reasonably trivial for most languages (except Perl, which is screwy, because of course it is).