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

Register all REPLs and make SPC m ' bindings #4826

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
2 changes: 2 additions & 0 deletions layers/+lang/clojure/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
:defer t
:init
(progn
(spacemacs/register-repl 'cider 'cider-jack-in "cider")
(setq cider-stacktrace-default-filters '(tooling dup)
cider-repl-pop-to-buffer-on-connect nil
cider-prompt-save-file-on-load nil
Expand Down Expand Up @@ -226,6 +227,7 @@ If called with a prefix argument, uses the other-window instead."
"gg" 'cider-find-var
"gr" 'cider-jump-to-resource

"'" 'cider-jack-in
"sb" 'cider-load-buffer
"sB" 'spacemacs/cider-send-buffer-in-repl-and-focus
"sc" 'cider-connect
Expand Down
3 changes: 3 additions & 0 deletions layers/+lang/common-lisp/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
:commands slime-mode
:init
(progn
(spacemacs/register-repl 'slime 'slime)
(setq slime-contribs '(slime-fancy
slime-indentation
slime-sbcl-exts
Expand All @@ -46,6 +47,8 @@

;; TODO: Add bindings for the SLIME debugger?
(spacemacs/set-leader-keys-for-major-mode 'lisp-mode
"'" 'slime

"cc" 'slime-compile-file
"cC" 'slime-compile-and-load-file
"cl" 'slime-load-file
Expand Down
2 changes: 2 additions & 0 deletions layers/+lang/elixir/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
:defer t
:init
(progn
(spacemacs/register-repl 'alchemist 'alchemist-iex-run "alchemist")
(add-hook 'elixir-mode-hook 'alchemist-mode)
(setq alchemist-project-compile-when-needed t)
(push 'alchemist-company company-backends-elixir-mode)
Expand Down Expand Up @@ -65,6 +66,7 @@
"mx" 'alchemist-mix-run
"mh" 'alchemist-mix-help

"'" 'alchemist-iex-run
"sc" 'alchemist-iex-compile-this-buffer
"si" 'alchemist-iex-run
"sI" 'alchemist-iex-project-run
Expand Down
3 changes: 3 additions & 0 deletions layers/+lang/elm/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
:mode ("\\.elm\\'" . elm-mode)
:init
(progn
(spacemacs/register-repl 'elm-mode 'elm-repl-load "elm")

(defun spacemacs/init-elm-mode ()
"Disable electric-indent-mode and let indentation cycling feature work"
(if (fboundp 'electric-indent-local-mode)
Expand Down Expand Up @@ -78,6 +80,7 @@
"ht" 'elm-oracle-type-at-point

;; repl
"'" 'elm-repl-load
"si" 'elm-repl-load
"sf" 'elm-repl-push-decl
"sF" 'spacemacs/elm-repl-push-decl-focus
Expand Down
1 change: 1 addition & 0 deletions layers/+lang/emacs-lisp/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
(dolist (mode '(emacs-lisp-mode lisp-interaction-mode))
(spacemacs/declare-prefix-for-mode mode "ms" "ielm")
(spacemacs/set-leader-keys-for-major-mode mode
"'" 'ielm
"si" 'ielm)))
:config
(defun ielm-indent-line ()
Expand Down
4 changes: 4 additions & 0 deletions layers/+lang/ess/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
:commands (R stata julia SAS)
:init
(progn
(spacemacs/register-repl 'ess-site 'julia)
(spacemacs/register-repl 'ess-site 'spacemacs/ess-start-repl "ess")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spacemacs/ess-start-repl won't do what we want it to here. It only works if a buffer is already open in ESS mode. Instead each REPL provided by ESS should be registered separately, i.e.,

      (spacemacs/register-repl 'ess-site 'julia)
      (spacemacs/register-repl 'ess-site 'R)
      (spacemacs/register-repl 'ess-site 'SAS)
      (spacemacs/register-repl 'ess-site 'stata)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I'll get to it later today!

(when (configuration-layer/package-usedp 'company)
(add-hook 'ess-mode-hook 'company-mode))))

Expand All @@ -73,8 +75,10 @@
((string= "SAS" ess-language) (call-interactively 'SAS))))

(spacemacs/set-leader-keys-for-major-mode 'ess-julia-mode
"'" 'julia
"si" 'julia)
(spacemacs/set-leader-keys-for-major-mode 'ess-mode
"'" 'spacemacs/ess-start-repl
"si" 'spacemacs/ess-start-repl
;; noweb
"cC" 'ess-eval-chunk-and-go
Expand Down
5 changes: 4 additions & 1 deletion layers/+lang/fsharp/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
(use-package fsharp-mode
:defer t
:init
(setq fsharp-doc-idle-delay .2)
(progn
(setq fsharp-doc-idle-delay .2)
(spacemacs/register-repl 'fsharp-mode 'fsharp-show-subshell "F#"))
:config
(progn

Expand Down Expand Up @@ -53,6 +55,7 @@

"ht" 'fsharp-ac/show-tooltip-at-point

"'" 'fsharp-show-subshell
"sb" 'fsharp-load-buffer-file
"sB" 'spacemacs/fsharp-load-buffer-file-focus
"si" 'fsharp-show-subshell
Expand Down
2 changes: 2 additions & 0 deletions layers/+lang/idris/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
(defun idris/init-idris-mode ()
(use-package idris-mode
:defer t
:init (spacemacs/register-repl 'idris-mode 'idris-ensure-process-and-repl-buffer "idris")
:config
(progn
(defun spacemacs/idris-load-file-and-focus (&optional set-line)
Expand Down Expand Up @@ -77,6 +78,7 @@
"mc" 'idris-show-core-term

;; REPL
"'" 'idris-ensure-process-and-repl-buffer
"sb" 'idris-load-file
"sB" 'spacemacs/idris-load-file-and-focus
"si" 'idris-ensure-process-and-repl-buffer
Expand Down
6 changes: 5 additions & 1 deletion layers/+lang/javascript/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@
(defun javascript/init-skewer-mode ()
(use-package skewer-mode
:defer t
:init (add-hook 'js2-mode-hook 'skewer-mode)
:init
(progn
(spacemacs/register-repl 'skewer-mode 'spacemacs/skewer-start-repl "skewer")
(add-hook 'js2-mode-hook 'skewer-mode))
:config
(progn
(defun spacemacs/skewer-start-repl ()
Expand Down Expand Up @@ -250,6 +253,7 @@
(evil-insert-state))

(spacemacs/set-leader-keys-for-major-mode 'js2-mode
"'" 'spacemacs/skewer-start-repl
"ee" 'skewer-eval-last-expression
"eE" 'skewer-eval-print-last-expression
"sb" 'skewer-load-buffer
Expand Down
6 changes: 5 additions & 1 deletion layers/+lang/ocaml/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@
(defun ocaml/init-utop ()
(use-package utop
:defer t
:init (add-hook 'tuareg-mode-hook 'utop-minor-mode)
:init
(progn
(add-hook 'tuareg-mode-hook 'utop-minor-mode)
(spacemacs/register-repl 'utop 'utop "ocaml"))
:config
(progn
;; Setup environment variables using opam
Expand Down Expand Up @@ -139,6 +142,7 @@
(evil-insert-state))

(spacemacs/set-leader-keys-for-major-mode 'tuareg-mode
"'" 'utop
"sb" 'utop-eval-buffer
"sB" 'spacemacs/utop-eval-buffer-and-go
"si" 'utop
Expand Down
2 changes: 2 additions & 0 deletions layers/+lang/octave/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
(use-package octave
:mode ("\\.m\\'" . octave-mode)
:commands (run-octave)
:init (spacemacs/register-repl 'octave 'run-octave "octave")
:config (spacemacs/set-leader-keys-for-major-mode 'octave-mode
;; helpers
"hh" 'octave-help
"hi" 'octave-lookfor
;; REPL
"'" 'run-octave
"sb" 'octave-send-buffer
"sf" 'octave-send-defun
"si" 'run-octave
Expand Down
2 changes: 2 additions & 0 deletions layers/+lang/purescript/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@
:defer t
:init
(progn
(spacemacs/register-repl 'psci 'psci "purescript")
(add-hook 'purescript-mode-hook 'inferior-psci-mode)
(spacemacs/set-leader-keys-for-major-mode 'purescript-mode
"'" 'psci
"sb" 'psci/load-current-file!
"si" 'psci
"sm" 'psci/load-module!
Expand Down
3 changes: 3 additions & 0 deletions layers/+lang/python/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@
:defer t
:init
(progn
(spacemacs/register-repl 'python 'python-start-or-switch-repl "python")

(defun python-default ()
(setq mode-name "Python"
tab-width 4
Expand Down Expand Up @@ -315,6 +317,7 @@
(spacemacs/declare-prefix-for-mode 'python-mode "mv" "pyenv")
(spacemacs/declare-prefix-for-mode 'python-mode "mV" "pyvenv")
(spacemacs/set-leader-keys-for-major-mode 'python-mode
"'" 'python-start-or-switch-repl
"cc" 'spacemacs/python-execute-file
"cC" 'spacemacs/python-execute-file-focus
"db" 'python-toggle-breakpoint
Expand Down
2 changes: 2 additions & 0 deletions layers/+lang/racket/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
(defun racket/init-racket-mode ()
(use-package racket-mode
:defer t
:init (spacemacs/register-repl 'racket-mode 'racket-repl "racket")
:config
(progn
;; smartparens configuration
Expand Down Expand Up @@ -79,6 +80,7 @@
;; insert
"il" 'racket-insert-lambda
;; REPL
"'" 'racket-repl
"sb" 'racket-run
"sB" 'spacemacs/racket-run-and-switch-to-repl
"se" 'racket-send-last-sexp
Expand Down
2 changes: 2 additions & 0 deletions layers/+lang/ruby/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
:defer t
:init
(progn
(spacemacs/register-repl 'robe 'robe-start "robe")
(dolist (hook '(ruby-mode-hook enh-ruby-mode-hook))
(add-hook hook 'robe-mode))
(when (configuration-layer/layer-usedp 'auto-completion)
Expand All @@ -136,6 +137,7 @@
(spacemacs/declare-prefix-for-mode mode "mh" "ruby/docs")
(spacemacs/declare-prefix-for-mode mode "ms" "ruby/repl")
(spacemacs/set-leader-keys-for-major-mode mode
"'" 'robe-start
;; robe mode specific
"gg" 'robe-jump
"hd" 'robe-doc
Expand Down
4 changes: 3 additions & 1 deletion layers/+lang/scala/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
:commands (ensime-mode)
:init
(progn
(spacemacs/register-repl 'ensime 'ensime-inf-switch "ensime")
(when scala-enable-eldoc
(add-hook 'ensime-mode-hook 'scala/enable-eldoc))
(add-hook 'scala-mode-hook 'scala/configure-flyspell)
Expand Down Expand Up @@ -96,7 +97,8 @@
(spacemacs/declare-prefix-for-mode 'scala-mode (car prefix) (cdr prefix)))

(spacemacs/set-leader-keys-for-major-mode 'scala-mode
"/" 'ensime-search
"/" 'ensime-search
"'" 'ensime-inf-switch

"bc" 'ensime-sbt-do-compile
"bC" 'ensime-sbt-do-clean
Expand Down
2 changes: 2 additions & 0 deletions layers/+lang/scheme/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
(defun scheme/init-geiser ()
(use-package geiser
:commands run-geiser
:init (spacemacs/register-repl 'geiser 'geiser-mode-switch-to-repl "geiser")
:config
(progn
(spacemacs/declare-prefix-for-mode 'scheme-mode "mc" "compiling")
Expand All @@ -25,6 +26,7 @@
(spacemacs/declare-prefix-for-mode 'scheme-mode "ms" "repl")

(spacemacs/set-leader-keys-for-major-mode 'scheme-mode
"'" 'geiser-mode-switch-to-repl
"," 'lisp-state-toggle-lisp-state

"cc" 'geiser-compile-current-buffer
Expand Down
2 changes: 2 additions & 0 deletions layers/+lang/sml/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
:mode ("\\.\\(sml\\|sig\\)\\'" . sml-mode)
:defer t
:commands run-sml
:init (spacemacs/register-repl 'sml-mode 'run-sml "sml")
:config
(progn
(defun spacemacs/sml-prog-proc-send-buffer-and-focus ()
Expand All @@ -42,6 +43,7 @@

(spacemacs/set-leader-keys-for-major-mode 'sml-mode
;; REPL
"'" 'run-sml
"sb" 'sml-prog-proc-send-buffer
"sB" 'spacemacs/sml-prog-proc-send-buffer-and-focus
"sf" 'sml-send-function
Expand Down
3 changes: 3 additions & 0 deletions layers/+lang/sql/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
(defun sql/init-sql ()
(use-package sql
:defer t
:init (spacemacs/register-repl 'sql 'spacemacs/sql-start "sql")
:config
(progn
(setq spacemacs-sql-highlightable sql-product-alist
Expand Down Expand Up @@ -78,6 +79,8 @@
(evil-insert-state)))

(spacemacs/set-leader-keys-for-major-mode 'sql-mode
"'" 'spacemacs/sql-start

;; sqli buffer
"bb" 'sql-show-sqli-buffer
"bs" 'sql-set-sqli-buffer
Expand Down