How do I make Emacs auto-indent my C code?

后端 未结 7 1101
一向
一向 2021-01-31 18:53

I\'m just starting to get a feel for emacs, but I am frustrated with it\'s tendency to not indent when I press the return key. I know if I press C-j it will do it, but I can\'t

7条回答
  •  难免孤独
    2021-01-31 19:20

    I set the return key to globally act as a new-line-and-intent in my ~/.emacs file:

    (global-set-key "\C-m" 'newline-and-indent)
    

    Works for me.

提交回复
热议问题