Fix nodejs repl + enhance narf:repl
This commit is contained in:
parent
f26ddf99ac
commit
a1bc073920
3 changed files with 11 additions and 6 deletions
|
@ -1,13 +1,17 @@
|
||||||
;;; defuns-repl.el
|
;;; defuns-repl.el
|
||||||
|
|
||||||
;;;###autoload (autoload 'narf:repl "defuns-repl" nil t)
|
;;;###autoload (autoload 'narf:repl "defuns-repl" nil t)
|
||||||
(evil-define-command narf:repl (&optional bang)
|
(evil-define-command narf:repl (&optional bang command)
|
||||||
:repeat nil
|
:repeat nil
|
||||||
(interactive "<!>")
|
(interactive "<!><a>")
|
||||||
(if (and narf--repl-buffer (buffer-live-p narf--repl-buffer))
|
(if (and narf--repl-buffer (buffer-live-p narf--repl-buffer))
|
||||||
(narf/popup-buffer narf--repl-buffer)
|
(narf/popup-buffer narf--repl-buffer)
|
||||||
(rtog/toggle-repl (if (use-region-p) 4))
|
(rtog/toggle-repl (if (use-region-p) 4))
|
||||||
(setq narf--repl-buffer (current-buffer))))
|
(setq narf--repl-buffer (current-buffer))
|
||||||
|
(when command
|
||||||
|
(with-current-buffer narf--repl-buffer
|
||||||
|
(insert command)
|
||||||
|
(unless bang (comint-send-input))))))
|
||||||
|
|
||||||
;;;###autoload (autoload 'narf:repl-eval "defuns-repl" nil t)
|
;;;###autoload (autoload 'narf:repl-eval "defuns-repl" nil t)
|
||||||
(evil-define-operator narf:repl-eval (&optional beg end bang)
|
(evil-define-operator narf:repl-eval (&optional beg end bang)
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
:mode "\\.js$"
|
:mode "\\.js$"
|
||||||
:interpreter "node"
|
:interpreter "node"
|
||||||
:init
|
:init
|
||||||
|
(use-package nodejs-repl :defer t :commands (nodejs-repl)
|
||||||
|
:config (evil-set-initial-state 'nodejs-repl-mode 'emacs))
|
||||||
|
|
||||||
(define-repl! js2-mode nodejs-repl)
|
(define-repl! js2-mode nodejs-repl)
|
||||||
(define-docset! js2-mode "js,javascript,nodejs,angularjs")
|
(define-docset! js2-mode "js,javascript,nodejs,angularjs")
|
||||||
:config
|
:config
|
||||||
|
@ -101,7 +104,5 @@
|
||||||
:config
|
:config
|
||||||
(setq-default coffee-indent-like-python-mode t))
|
(setq-default coffee-indent-like-python-mode t))
|
||||||
|
|
||||||
(use-package nodejs-repl :defer t)
|
|
||||||
|
|
||||||
(provide 'module-js)
|
(provide 'module-js)
|
||||||
;;; module-js.el ends here
|
;;; module-js.el ends here
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
"M-T" 'narf/tab-display
|
"M-T" 'narf/tab-display
|
||||||
"A-`" 'os-switch-to-term
|
"A-`" 'os-switch-to-term
|
||||||
"C-`" 'narf/popup-messages
|
"C-`" 'narf/popup-messages
|
||||||
"C-~" 'rtog/toggle-repl
|
"C-~" 'narf:repl
|
||||||
"M-`" 'narf/popup-toggle
|
"M-`" 'narf/popup-toggle
|
||||||
|
|
||||||
"M-w" 'narf/close-window-or-tab
|
"M-w" 'narf/close-window-or-tab
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue