Emacs: Indentation Commands
Indent Current Line
indent-for-tab-command
【Tab】- indent current line or region.
Indent a Text Selection
- Alt+x
indent-region
【Ctrl+Alt+\】 - Indent a region. Select a region first.
- Alt+x
indent-rigidly
- Indent all lines in a region in a fixed way. Press → to move to right or ← to left.
More indent commands:
- Alt+x
indent-relative
- Indent current line in the same style as previous non-blank line.
- Alt+x
indent-relative-maybe
- Indent current line like previous non-blank line, only if the previous line has more indent than current line.
Convert Tabs to Space
- Alt+x
untabify
- Convert tabs to spaces. In region. Press Ctrl+u first to do whole buffer.
- Alt+x
tabify
- Convert spaces to tabs. In region. Press Ctrl+u first to do whole buffer.