Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Indent several lines in Emacs

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?

like image 599
SoftTimur Avatar asked Jul 29 '12 23:07

SoftTimur


People also ask

How do you indent multiple rows?

You can select multiple rows (select the first row in the far left and hold down shift and select the last row) and then use the Indent/Outdent feature to change them.

How do you indent multiple lines VSC?

You can select all and use SHIFT + TAB to unindent.

How do I indent a group in vim?

Put the cursor anywhere in the first line. Press V then jj to visually select the three lines. Press > to indent (shift text one ' shiftwidth ' to the right), or press < to shift left. Press . to repeat the indent, or u to undo if you have shifted too far.


1 Answers

Select multiply lines, then type C-u 8 C-x Tab, it will indent the region by 8 spaces.

C-u -4 C-x Tab will un-indent by 4 spaces

like image 129
kev Avatar answered Oct 13 '22 15:10

kev