The most intuitively way I have found to indent your selection in Emacs is with the following keybinding:
With this binding you can select a block of text like regular and…
Control + >
to indent rightControl + <
to indent leftSo, maybe you don’t want to set a custom keybinding for whatever reason. There is still hope.
There is no default keybinding (at least from what I have found) for the commands indent-rigidly-{right or left}-to-tab-stop
but there is a keybinding for indent-rigidly
.
Control + x
TAB
You first hit Control+x
and then you press tab
. Now you can use the left and right arrows to indent and de-indent.
The one quirk you’ll notice is that this method indents and de-indents by single spaces rather than full tabs.
This took me a while to figure out but it is quite easy to implement.
Drop a comment if you think I should expand this article, covering other information.
Make sure to also check out my Ultimate Guide to Emacs Indentation.
Leave a comment