ESS allows us to indent a line and an expression. Is there a key binding for indenting a buffe开发者_如何学Gor? If not, can we create it?
As stated by others you could mark the whole buffer C-x h
and then indent the region with C-M-\
You could also put something along these lines in your .emacs
file:
(defun my-indent-buffer()
(interactive)
(save-excursion
(indent-region (point-min) (point-max))))
(global-set-key "\C-cib" 'my-indent-buffer)
This has the benefit of remembering your point.
Not sure about a buffer but you can mark a region and then use C-M-\
on it.
精彩评论