Indent several lines in Emacs

Viewed 26310

In my Emacs, space key can indent correctly 1 line. If I select several lines, and press space key, the indenting does not work.

By following this link, I try C-M-\ or C-M-q, but C-M deletes directly the whole block selected.

Here is my .emacs, could anyone help?

5 Answers

[Warning: This approach might lead to errors as mentioned in one of the comments. Iniviting suggestions to fix it.]

Steps to do indentation interactively.

  1. Select the region to be indented.
  2. C-x TAB.
  3. Use arrows (← and →) to indent interactively.
  4. Press Esc three times when you are done with the required indentation.

None of the above method worked for me except Kev's- and that is too verbose for my slow fingers.

For me, I can highlight the region and press Alt-left arrow . Strangely, even though Alt registers as meta in emacs, Esc-left arrow doesn't work.

Related