Standardize REPL commands & improve SPC o r

- SPC o r now prompts for a REPL to open when none was found for the
  current buffer.
- REPL handlers must now follow the naming convention "*/open*-repl".
  e.g. +python/open-ipython-repl, +emacs-lisp/open-repl, etc.
- +eval/open-repl has been split in two:
  - +eval/open-repl-other-window
  - +eval/open-repl-same-window
This commit is contained in:
Henrik Lissner 2019-02-18 01:56:38 -05:00
parent 4437d80133
commit 94b16cba6c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
19 changed files with 83 additions and 52 deletions

View file

@ -34,5 +34,5 @@ sudo pacman --needed --noconfirm -S nodejs npm
** Commands
| command | key / ex command | description |
|----------------------------------+------------------+------------------------------------------------------------|
| ~+javascript/repl~ | =:repl= | Open the NodeJS REPL (or send the current selection to it) |
| ~+javascript/open-repl~ | =:repl= | Open the NodeJS REPL (or send the current selection to it) |
| ~+javascript/skewer-this-buffer~ | =SPC m S= | Attaches a browser to the current buffer |

View file

@ -36,7 +36,7 @@ ignore the cache."
;; Commands
;;;###autoload
(defun +javascript/repl ()
(defun +javascript/open-repl ()
"Open a Javascript REPL. Meaning either `skewer-repl', if any of the
skewer-*-mode's are enabled, or `nodejs-repl' otherwise."
(interactive)

View file

@ -52,7 +52,7 @@
mode-name "JS2")
(set-electric! 'js2-mode :chars '(?\} ?\) ?. ?:))
(set-repl-handler! 'js2-mode #'+javascript/repl)
(set-repl-handler! 'js2-mode #'+javascript/open-repl)
(map! :map js2-mode-map
:localleader