Rscript有没有可用的emacs模式?
(Rscript是R语言的脚本前端。)
如果我键入以下内容:
#!/usr/bin/Rscript
print(commandArgs(TRUE))在ESS R模式下执行indent它会疯狂地缩进第一行,因为它将第一行视为注释:
#!/usr/bin/Rscript
print(commandArgs(TRUE))发布于 2009-08-11 22:56:40
没有,但是你可以强制你的Rscript进入R编辑模式,让文件的第二行看起来像这样:
# -*- mode: R -*-(更多信息here。)
发布于 2010-03-19 01:23:32
从5.9版本开始,ESS将使用Rscript或litter解释器识别脚本;请参阅http://ess.r-project.org/Manual/ess.html#New-features。
作为参考,要将模式分配给解释器,请使用解释器模式列表变量。例如,
(add-to-list 'interpreter-mode-alist '("Rscript" . r-mode))任何第一行类似"#!/usr/bin/Rscript“的文件都将被识别为r-mode。
发布于 2009-07-10 14:26:52
使用一些notes on customized indentation尝试shell-script-mode
对我来说,它可以很好地缩进你的代码。
https://stackoverflow.com/questions/1107605
复制相似问题