I found a neat code snippet for ~/.emacs
configuration:
(global-set-key (kbd "C->")
(lambda (b e &optional n)
(interactive "r")
(indent-code-rigidly b e (or n 4)))
)
(global-set-key (kbd "C-<")
(lambda (b e &optional n)
(interactive "r")
(indent-code-rigidly b e (or n (- 0 4))))
)
This snippet allows me to use C->
/C-<
hotkeys to force indent/unindent selected code block.
But after indent/uindent applies to code block, selection is lost. How to retain selection (or select again same code lines) programmatically?