EmacsWiki: Category Indentation (original) (raw)
Click on the title to list all pages related to Indentation questions.
“The power of Emacs comes at a cost.” – kensanata on #emacs
For people troubled by the default indentation behaviour, there is the IndentationTutorial. If that doesn’t work, EricPement has a page on Emacs and Tabs at http://www.pement.org/emacs_tabs.htm
Most people seem to be concerned about the following, though:
- IndentingText – for plain text without automatic indentation
- IndentingSourceCode – for program source or other inherently structured text
- IndentingLisp – Lisp, Scheme, EmacsLisp source code
- IndentingC – C, C++, and Java source code
- IndentingPerl – Perl source code
- IndentingPython – Python source code, where it’s syntactically significant
- IndentingHtml – plain HTML mode does not do indentation
- IndentingXml – using the new SgmlMode
- GuessStyle – guess variables like c-basic-offset, tab-width and indent-tabs-mode
- GuessOffset – guess the offset used in existing files and use it
- ReformatBuffer – marking the whole buffer and reindenting it
- CodeBeautifying – how to wrap comments after reindenting the buffer
- TabCompletion – How to indent and get completion too.
Related:
- IndentationBasics – various variables
- AutoIndentation – how to indent new lines automatically
- CleanAutoIndent – indentation without abandoned trailing white spaces
- NoTabs – how to avoid tabs altogether (see also TabsAreEvil)
- SmartTabs – how to use tabs for indentation and spaces for alignment
- UntabifyUponSave – save all files with spaces instead of tabs
- ShowWhiteSpace – Visualize spaces and tabs with color highlighting.
- HighlightIndentation – Show vertical guide lines for each indentation level (spaces only).
- DoubleSpaceDefuns – Ensure there is one and only one blank line between function definitions.
External:
- KaiGrossjohann’s indentation tutorial: http://www.xemacs.org/Links/tutorials_toc.html or http://cvs.sourceforge.net/viewcvs.py/xemacs/xemacsweb/Links/Attic/tutorials_toc.html
- EricPement has a document that explains TABs in Emacs: http://www.pement.org/emacs_tabs.htm
- Python-like indentation for all modes: https://github.com/vitalya-dev/project-i
Aligning columns of text:
- CategoryAlignment – several ways to align text, with respect to assignment, whitespace, or regexp-provided delimiters.
- AlignColumn – align text columns, where the columns are separated by whitespace
- AlignLet – align values in Lisp
let
forms
Indentation implementation details:
- TabStopList – the fallback usually used when no other indentation seems to work