Move ESS packages into a lang contrib

This commit is contained in:
syl20bnr 2014-11-10 22:27:06 -05:00
parent b33cbba0b3
commit c811795332
4 changed files with 92 additions and 79 deletions

View File

@ -114,9 +114,6 @@ for contribution guidelines_
- [Testing in Python](#testing-in-python)
- [Other Python commands](#other-python-commands)
- [JavaScript](#javascript)
- [R (ESS)](#r-ess)
- [Inferior REPL process](#inferior-repl-process)
- [Other R commands](#other-r-commands)
- [rcirc](#rcirc)
- [Tips](#tips)
- [Tips for Emacs users](#tips-for-emacs-users)
@ -1618,43 +1615,6 @@ Tern includes the following key bindings:
`C-c C-c` | find the type of the thing under the cursor.
`C-c C-d` | find docs of the thing under the cursor. Press again to open the associated URL (if any).
#### R (ESS)
**Important**:
In order to speed up the boot time of `Spacemacs`, `ESS` must be loaded
manually via the key binding:
<SPC> e s s
##### Inferior REPL process
Start an `R` inferior REPL process with `<SPC> m i`.
Send code to inferior process commands:
Key Binding | Description
------------------|------------------------------------------------------------
`<SPC> m b` | send buffer and keep code buffer focused
`<SPC> m B` | send buffer and switch to REPL in insert mode
`<SPC> m f` | send function and keep code buffer focused
`<SPC> m F` | send function and switch to REPL in insert mode
`<SPC> m l` | send line and keep code buffer focused
`<SPC> m L` | send line and switch to REPL in insert mode
`<SPC> m r` | send region and keep code buffer focused
`<SPC> m R` | send region and switch to REPL in insert mode
`<SPC> m s` | send region or line and step (debug)
`<SPC> m S` | send function or paragraph and step (debug)
`CTRL+j` | next item in REPL history
`CTRL+k` | previous item in REPL history
##### Other R commands
Key Binding | Description
------------------|------------------------------------------------------------
`<SPC> m p` | object introspection popup [ess-R-object-popup][ess-R-object-popup]
`<SPC> m v p` | view data under point using [ess-R-data-view][ess-R-data-view]
`<SPC> m v t` | view table using [ess-R-data-view][ess-R-data-view]
#### rcirc
Key Binding | Description

View File

@ -0,0 +1,48 @@
# R (ESS) contribution layer for Spacemacs
## Install
To use this contribution add it to your `~/.spacemacs`
```elisp
(defvar dotspacemacs-configuration-layers '(ess)
"List of contribution to load."
)
```
## Key Bindings
**Important**:
In order to speed up the boot time of `Spacemacs`, `ESS` must be loaded
manually via the key binding:
<SPC> e s s
### Inferior REPL process
Start an `R` inferior REPL process with `<SPC> m i`.
Send code to inferior process commands:
Key Binding | Description
------------------|------------------------------------------------------------
`<SPC> m b` | send buffer and keep code buffer focused
`<SPC> m B` | send buffer and switch to REPL in insert mode
`<SPC> m f` | send function and keep code buffer focused
`<SPC> m F` | send function and switch to REPL in insert mode
`<SPC> m l` | send line and keep code buffer focused
`<SPC> m L` | send line and switch to REPL in insert mode
`<SPC> m r` | send region and keep code buffer focused
`<SPC> m R` | send region and switch to REPL in insert mode
`<SPC> m s` | send region or line and step (debug)
`<SPC> m S` | send function or paragraph and step (debug)
`CTRL+j` | next item in REPL history
`CTRL+k` | previous item in REPL history
### Other R commands
Key Binding | Description
------------------|------------------------------------------------------------
`<SPC> m p` | object introspection popup [ess-R-object-popup][ess-R-object-popup]
`<SPC> m v p` | view data under point using [ess-R-data-view][ess-R-data-view]
`<SPC> m v t` | view table using [ess-R-data-view][ess-R-data-view]

View File

@ -0,0 +1,44 @@
(defvar ess-packages
'(
ess
ess-R-data-view
ess-R-object-popup
ess-smart-underscore
)
"List of all packages to install and/or initialize. Built-in packages
which require an initialization must be listed explicitly in the list.")
(defun spacemacs/init-ess ()
;; ESS is not quick to load so we just load it when
;; we need it (see my-keybindings.el for the associated
;; keybinding)
(defun load-ess-on-demand ()
(interactive)
(use-package ess-site)
(use-package ess-smart-underscore)
(use-package ess-R-object-popup)
(use-package ess-R-data-view)
)
(evil-leader/set-key "ess" 'load-ess-on-demand)
;; R --------------------------------------------------------------------------
(eval-after-load "ess-site"
'(progn
(evil-leader/set-key-for-mode 'ess-mode
"mB" 'ess-eval-buffer-and-go
"mb" 'ess-eval-buffer
"mF" 'ess-eval-function-and-go
"mf" 'ess-eval-function
"mi" 'R
"mL" 'ess-eval-line-and-go
"ml" 'ess-eval-line
"mp" 'ess-R-object-popup
"mR" 'ess-eval-region-and-go
"mr" 'ess-eval-region
"mS" 'ess-eval-function-or-paragraph-and-step
"ms" 'ess-eval-region-or-line-and-step
"mvp" 'ess-R-dv-pprint
"mvt" 'ess-R-dv-ctable
)
(define-key inferior-ess-mode-map (kbd "C-j") 'comint-next-input)
(define-key inferior-ess-mode-map (kbd "C-k") 'comint-previous-input))))

View File

@ -23,10 +23,6 @@
ensime
epc
erlang
ess
ess-R-data-view
ess-R-object-popup
ess-smart-underscore
evil
evil-args
evil-escape
@ -855,41 +851,6 @@ determine the state to enable when escaping from the insert state.")
;; (erlang-flymake-only-on-save)
)
(defun spacemacs/init-ess ()
;; ESS is not quick to load so we just load it when
;; we need it (see my-keybindings.el for the associated
;; keybinding)
(defun load-ess-on-demand ()
(interactive)
(use-package ess-site)
(use-package ess-smart-underscore)
(use-package ess-R-object-popup)
(use-package ess-R-data-view)
)
(evil-leader/set-key "ess" 'load-ess-on-demand)
;; R --------------------------------------------------------------------------
(eval-after-load "ess-site"
'(progn
(evil-leader/set-key-for-mode 'ess-mode
"mB" 'ess-eval-buffer-and-go
"mb" 'ess-eval-buffer
"mF" 'ess-eval-function-and-go
"mf" 'ess-eval-function
"mi" 'R
"mL" 'ess-eval-line-and-go
"ml" 'ess-eval-line
"mp" 'ess-R-object-popup
"mR" 'ess-eval-region-and-go
"mr" 'ess-eval-region
"mS" 'ess-eval-function-or-paragraph-and-step
"ms" 'ess-eval-region-or-line-and-step
"mvp" 'ess-R-dv-pprint
"mvt" 'ess-R-dv-ctable
)
(define-key inferior-ess-mode-map (kbd "C-j") 'comint-next-input)
(define-key inferior-ess-mode-map (kbd "C-k") 'comint-previous-input))))
(defun spacemacs/init-evil-nerd-commenter ()
(use-package evil-nerd-commenter
:init