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

后端 未结 7 1086
一向
一向 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:32

    The easy way to do that is to use electric-indent-mode. If you want to enable it manually, just do

    M-x electric-indent-mode
    

    In order to enable it automatically, say the following in your .emacs:

    (electric-indent-mode)
    

    This will be the default in Emacs 24.4.

提交回复
热议问题