Emacs缩进

dar*_*sky 2 c emacs cc-mode

在Emacs中,只有在返回(在cc模式下)后,该行才会缩进.这是正常的吗?可以在更换新线时自动更改为缩进吗?

例如,我如何看待变量There are a number of predefined styles. Take a look at the variable ‘c-style-alist’ to see a list of them.

jta*_*orn 5

在我的所有编程模式钩子中我都有这一行:

(local-set-key [return] 'newline-and-indent)
Run Code Online (Sandbox Code Playgroud)

例如,如果你想在所有"c"模式中使用它,你可以将它添加到.emacs文件中:

(add-hook 'c-mode-common-hook
          (lambda ()
            (local-set-key [return] 'newline-and-indent)))
Run Code Online (Sandbox Code Playgroud)

第二个问题:

要描述某些内容,您可以使用help命令."v"获取变量的帮助,因此您将使用:M-x help v