r - Emacs ESS 模式 - 注释区域的 Tab 键切换

标签 r emacs ess

我正在使用 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/

相关文章:

R 汇总 dplyr 分组数据,并根据另一列排除某些行

R Shiny : not sure why ggplot is failing

r - ESS 找不到指定包中的文档

emacs - 在多术语中使用 emacs shell (eshell)

emacs - ESS 在 windows 上找不到 Rterm.exe

emacs - Flycheck ESS 模式下的 lintr 错误

r - 如何在 R 或 gnuplot 中应用功率拟合趋势线?

r - R中data.frame中每一列的第N个最小值

Emacs - 在用外部程序打开文件之前拦截文件并修改它,然后打开修改后的verison

emacs - ESS + AUCTeX +编织。来自.Rnw <-> pdfviewer的SyncteX集成?