-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
236 additions
and
439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
(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.") | ||
|
||
(defvar ess-excluded-packages '() | ||
"List of packages to exclude.") | ||
|
||
(defun ess/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)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.