block indent / dedent in emacs
January 7th, 2007 by Lawrence David
to indent or dedent a block of text in emacs, first set a markpoint:
C-space
move the cursor to the end of the block, and then hit:
C-c->
to indent or
C-c-<
to dedent. Thanks to Chad Netzer for that hint!
FYI: The opposite of “indent” is “outdent,” not “dedent.”
It did not work for me in putty
Try this.
Select region using C-space
C-x-TAB to indent the region
I’m kindda late since the last comment was in 2007 but this is just great!!
This is way better than C-i on each line….
guopvzky gbkvianz frjnhzqbw fhja qwjyvcmf pengwuchq gqtchvsaj
Awesome, thanks!
Lawrence’s initial method works generally, but only in certain modes. For example, it works in python-mode but not text-mode. So the trick is to change your buffer to python-mode, do the indent using C-c + >, and then switch back to the original mode.