Feeds:
Posts
Comments

Posts Tagged ‘Global Indentation’


Global Indentation

In order to get what people like to call smart indentation on Emacs, the easiest way is to add a couple of lines to the .emacs configuration to declare that every newline should be indented.

(define-key global-map (kbd "RET") 'newline-and-indent)
(setq-default indent-tabs-mode t)

The first line defines a global1 shortcut 2 for the command newline-and-indent assigned to the RET key (known Enter).

The second line turns-on (the t at the end means true) the TAB indentation… if it’s not turned-on by default!

Footnotes:

1global means that it is valid for any emacs mode
2In emacs-lisp it is called define-key

Author: Oscar Castillo-Felisola

Created: 2013-11-07 Thu 15:08

Emacs 23.4.1 (Org mode 8.2.1)

Advertisements

Read Full Post »