help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Indenting with the tab key like everyone else


From: Emanuel Berg
Subject: Re: Indenting with the tab key like everyone else
Date: Tue, 04 Jun 2019 03:19:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

R. Diez via help-gnu-emacs wrote:

> I want the same behaviour as most other IDEs
> I know: If I just press tab, it should
> "intelligently" indent the current line of
> code as usual. But if I select several lines
> with the shift key, I want to rigidly indent
> the selected block of lines. At the moment,
> Emacs tries to reindent the selected lines,
> which often does nothing, because it thinks
> the lines are already properly indented.

TAB is the "intelligent" way and that works for
regions as well. This makes sense IMO.

If you want to just mechanically move a region
forward or backward, first set the region, then
do

`C-u C-x TAB' for 4 steps

`C-u C-u C-x TAB' for 4**2=16 steps (and so on),

and for arbitrary values, do, e.g.,

`C-u 3 C-x TAB' for 3 steps (and so on).

You can also do `C-u -2 C-x TAB' to move back
two steps, for example.

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]