darksky
darksky

Reputation: 21019

Emacs indentation

In Emacs, the line gets indented only after hitting return (in cc-mode). Is that normal? Can that be changed to indent automatically when it hits a new line?

How do I look at variables, for example There are a number of predefined styles. Take a look at the variable ‘c-style-alist’ to see a list of them.?

Upvotes: 2

Views: 398

Answers (2)

clatter
clatter

Reputation: 91

For the first question, M-x electric-indent-mode should do the trick.

Upvotes: 0

jtahlborn
jtahlborn

Reputation: 53674

in all of my programming mode hooks i have this line:

(local-set-key [return] 'newline-and-indent)

if for example, you wanted this in all "c" like modes, you would add this to your .emacs file:

(add-hook 'c-mode-common-hook
          (lambda ()
            (local-set-key [return] 'newline-and-indent)))

Second question:

to describe something, you would use the help command. "v" gets help on variables, so you would use: M-x help v

Upvotes: 5

Related Questions