Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RMarkdown support to ESS layer. #5126

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions layers/+lang/ess/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
- [[Inferior REPL process][Inferior REPL process]]
- [[Helpers][Helpers]]
- [[Options][Options]]
- [[RMarkdown support][RMarkdown support]]

* Install
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
add =ess= to the existing =dotspacemacs-configuration-layers= list in this
file.

To use Knitr follow the [[https://github.com/yihui/knitr#installation][installation instructions]] on the official github site.

* Key Bindings

** Inferior REPL process
Expand Down Expand Up @@ -67,3 +70,8 @@ hook:
(lambda ()
(ess-toggle-underscore nil)))
#+end_src

* RMarkdown support
RMarkdown files ~.Rmd~ are supported by using [[https://github.com/vspinu/polymode][polymode]]. They can be knitted to
~.md~ files using ~M-x ess-swv-knit~ .

11 changes: 10 additions & 1 deletion layers/+lang/ess/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
ess-R-object-popup
ess-smart-equals
rainbow-delimiters
polymode
))

(defun ess/init-ess ()
Expand Down Expand Up @@ -48,7 +49,8 @@
("\\.[Bb][Mm][Dd]\\'" . ess-bugs-mode)
("\\.[Jj][Aa][Gg]\\'" . ess-jags-mode)
("\\.[Jj][Oo][Gg]\\'" . ess-jags-mode)
("\\.[Jj][Mm][Dd]\\'" . ess-jags-mode))
("\\.[Jj][Mm][Dd]\\'" . ess-jags-mode)
("\\.Rmd" . poly-markdown+r-mode))
:commands (R stata julia SAS)
:init
(progn
Expand Down Expand Up @@ -124,3 +126,10 @@
(progn
(add-hook 'ess-mode-hook 'ess-smart-equals-mode)
(add-hook 'inferior-ess-mode-hook 'ess-smart-equals-mode))))

(defun ess/init-polymode ()
(use-package poly-R
:defer t)
(use-package poly-markdown
:defer t)
)