我正在使用 Emacs 的 Emacs-Speaks-Statistics (ESS) 模式。编辑 R 代码时,当我在其上方创建新行时,任何注释行(以 # 开头的注释行)都会自动切换到最右侧。我应该如何更改我的 .emacs.el 文件来解决这个问题?
例如,我有:
# Comment
现在,将光标放在行首并按 Enter 键后,我得到:
# Comment
感谢您的任何提示。
最佳答案
如果您不希望注释缩进,请使用“###”。根据manual ,
By default, comments beginning with ‘###’ are aligned to the beginning of the line. Comments beginning with ‘##’ are aligned to the current level of indentation for the block containing the comment. Finally, comments beginning with ‘#’ are aligned to a column on the right (the 40th column by default, but this value is controlled by the variable comment-column,) or just after the expression on the line containing the comment if it extends beyond the indentation column.
关于r - Emacs ESS 模式 - 注释区域的 Tab 键切换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/780796/