在.emacs文件中添加
(add-to-list ‘load-path "/usr/share/emacs/site-lisp/ess")
(require ‘ess-site)
;;可选配置
;;设置ESS的Working目录
(setq ess-ask-for-ess-directory nil)
(setq ess-set-working-directory "~/R/")
;;设置默认语言
;;(setq ess-ask-for-dialect nil)
(setq ess-dialect "R")
(add-to-list ‘auto-mode-alist ‘("\\.R$" . R-mode))
(add-to-list ‘auto-mode-alist ‘("\\.r$" . R-mode))
(setq ess-local-process-name "R")
(setq ansi-color-for-comint-mode ‘filter)
(setq comint-prompt-read-only t)
(setq comint-scroll-to-bottom-on-input t)
(setq comint-scroll-to-bottom-on-output t)
(setq comint-move-point-for-output t)
(global-set-key [(meta i)] ‘ess-eval-line)
(global-set-key [(meta o)] ‘ess-eval-region)
(global-set-key [(meta p)] ‘ess-eval-buffer)
原文地址:http://blog.csdn.net/hxianxian/article/details/46055463