代码拉取完成,页面将自动刷新
;;; +ESS-R.el --- config for R -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
;; -------- ESS smart operators (for R) --------
(use-package ess-smart-equals
:defer t
:init
(setq ess-smart-equals-extra-ops '(brace paren percent))
(dolist (ess-r-relative-mode-hook
(list
'ess-r-mode-hook
'inferior-ess-r-mode-hook
'ess-r-transcript-mode-hook
'ess-roxy-mode-hook))
(add-hook ess-r-relative-mode-hook
(lambda ()
(ess-smart-equals-mode))))
:config
(ess-smart-equals-activate))
;; -------- update ESS (for R on Linux) --------
(use-package ess-site
:ensure ess
:defer t
:if (executable-find "R")
:preface
;; -------- highlight function names & keywords in R --------
(dolist (hook '(ess-mode-hook ess-r-mode-hook inferior-ess-r-mode-hook))
(add-hook hook
(lambda()
(font-lock-add-keywords
nil
'(("\\<\\(if\\|for\\|function\\|return\\|$\\|@\\)\\>[\n[:blank:]]*(" 1
font-lock-keyword-face) ; must go first to override highlighting below
("\\<\\([.A-Za-z][._A-Za-z0-9]*\\)[\n[:blank:]]*(" 1
font-lock-function-name-face) ; highlight function names
("\\([(,]\\|[\n[:blank:]]*\\)\\([.A-Za-z][._A-Za-z0-9]*\\)[\n[:blank:]]*=[^=]"
2 font-lock-builtin-face)
;; highlight numbers
("\\(-?[0-9]*\\.?[0-9]*[eE]?-?[0-9]+[iL]?\\)" 1 font-lock-constant-face)
;; highlight operators
("\\(\\$\\|\\@\\|\\!\\|\\%\\|\\^\\|\\&\\|\\*\\|\(\\|\)\\|\{\\|\}\\|\\[\\|\\]\\|\\-\\|\\+\\|\=\\|\\/\\|\<\\|\>\\|:\\)" 1 font-lock-type-face)
;; highlight S4 methods
("\\(setMethod\\|setGeneric\\|setGroupGeneric\\|setClass\\|setRefClass\\|setReplaceMethod\\)" 1 font-lock-preprocessor-face)
;; highlight packages called through ::, :::
("\\(\\w+\\):\\{2,3\\}" 1 font-lock-type-face)
)))))
:init
(setq comint-prompt-read-only t
comint-scroll-to-bottom-on-input 'this
comint-scroll-to-bottom-on-output 'others
ess-ask-for-ess-directory nil
ess-history-file "~/R/.R_history"
;; ess-indent-level 2
;; ess-set-style 'GNU
;; ess-set-style 'RStudio-
tab-always-indent t
ess-use-eldoc t
ess-use-flymake nil
inferior-R-args "--no-save --quiet")
(setq ess-startup-directory "~/rhome")
:commands R
:bind
("C-c R" . run-ess-r))
;; -------- poly-mode --------
(use-package polymode
:defer t
:mode (("\\.[rR]md\\'" . poly-gfm+r-mode)))
(provide '+ESS-R)
;; ;; (autoload 'ess-r-mode "ess-site.el" nil t)
;; (eval-after-load "comint"
;; '(progn
;; (define-key comint-mode-map "\C-p"
;; 'comint-previous-matching-input-from-input)
;; (define-key comint-mode-map "\C-n"
;; 'comint-next-matching-input-from-input)
;; (define-key comint-mode-map "\C-u"
;; 'comint-kill-input)))
;;; +ESS-R.el ends here
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。