From 06770dbe60e91ebc2d2d75ac42e129ff44efb19c Mon Sep 17 00:00:00 2001 From: Eivind Fonn Date: Tue, 26 Jan 2016 17:31:15 +0100 Subject: [PATCH] Register all REPLs and make SPC m ' bindings --- layers/+lang/clojure/packages.el | 2 ++ layers/+lang/common-lisp/packages.el | 3 +++ layers/+lang/elixir/packages.el | 2 ++ layers/+lang/elm/packages.el | 3 +++ layers/+lang/emacs-lisp/packages.el | 1 + layers/+lang/ess/packages.el | 4 ++++ layers/+lang/fsharp/packages.el | 5 ++++- layers/+lang/idris/packages.el | 2 ++ layers/+lang/javascript/packages.el | 6 +++++- layers/+lang/ocaml/packages.el | 6 +++++- layers/+lang/octave/packages.el | 2 ++ layers/+lang/purescript/packages.el | 2 ++ layers/+lang/python/packages.el | 3 +++ layers/+lang/racket/packages.el | 2 ++ layers/+lang/ruby/packages.el | 2 ++ layers/+lang/scala/packages.el | 4 +++- layers/+lang/scheme/packages.el | 2 ++ layers/+lang/sml/packages.el | 2 ++ layers/+lang/sql/packages.el | 3 +++ 19 files changed, 52 insertions(+), 4 deletions(-) diff --git a/layers/+lang/clojure/packages.el b/layers/+lang/clojure/packages.el index 12d65a1ea6bd..2f1a6b1b12c3 100644 --- a/layers/+lang/clojure/packages.el +++ b/layers/+lang/clojure/packages.el @@ -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 @@ -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 diff --git a/layers/+lang/common-lisp/packages.el b/layers/+lang/common-lisp/packages.el index 0c0d67700e46..94214fa53aff 100644 --- a/layers/+lang/common-lisp/packages.el +++ b/layers/+lang/common-lisp/packages.el @@ -23,6 +23,7 @@ :commands slime-mode :init (progn + (spacemacs/register-repl 'slime 'slime) (setq slime-contribs '(slime-fancy slime-indentation slime-sbcl-exts @@ -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 diff --git a/layers/+lang/elixir/packages.el b/layers/+lang/elixir/packages.el index 700957ca45f4..847087470efb 100644 --- a/layers/+lang/elixir/packages.el +++ b/layers/+lang/elixir/packages.el @@ -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) @@ -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 diff --git a/layers/+lang/elm/packages.el b/layers/+lang/elm/packages.el index 865402d159be..d5a2bbb766a0 100644 --- a/layers/+lang/elm/packages.el +++ b/layers/+lang/elm/packages.el @@ -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) @@ -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 diff --git a/layers/+lang/emacs-lisp/packages.el b/layers/+lang/emacs-lisp/packages.el index 29db9dee540b..b8cad311b819 100644 --- a/layers/+lang/emacs-lisp/packages.el +++ b/layers/+lang/emacs-lisp/packages.el @@ -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 () diff --git a/layers/+lang/ess/packages.el b/layers/+lang/ess/packages.el index f4b529fd0d71..de04b03c2b7c 100644 --- a/layers/+lang/ess/packages.el +++ b/layers/+lang/ess/packages.el @@ -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") (when (configuration-layer/package-usedp 'company) (add-hook 'ess-mode-hook 'company-mode)))) @@ -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 diff --git a/layers/+lang/fsharp/packages.el b/layers/+lang/fsharp/packages.el index 2572675a1856..075d04c5b43a 100644 --- a/layers/+lang/fsharp/packages.el +++ b/layers/+lang/fsharp/packages.el @@ -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 @@ -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 diff --git a/layers/+lang/idris/packages.el b/layers/+lang/idris/packages.el index e8c61af18e21..0570fae74055 100644 --- a/layers/+lang/idris/packages.el +++ b/layers/+lang/idris/packages.el @@ -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) @@ -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 diff --git a/layers/+lang/javascript/packages.el b/layers/+lang/javascript/packages.el index 43db5646e2b6..9d012c93ea7d 100644 --- a/layers/+lang/javascript/packages.el +++ b/layers/+lang/javascript/packages.el @@ -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 () @@ -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 diff --git a/layers/+lang/ocaml/packages.el b/layers/+lang/ocaml/packages.el index 7e425e707a5a..0c51579281d4 100644 --- a/layers/+lang/ocaml/packages.el +++ b/layers/+lang/ocaml/packages.el @@ -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 @@ -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 diff --git a/layers/+lang/octave/packages.el b/layers/+lang/octave/packages.el index 89917a164e7a..0695ee6e7028 100644 --- a/layers/+lang/octave/packages.el +++ b/layers/+lang/octave/packages.el @@ -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 diff --git a/layers/+lang/purescript/packages.el b/layers/+lang/purescript/packages.el index f3c0452e9330..f2c1d332ed39 100644 --- a/layers/+lang/purescript/packages.el +++ b/layers/+lang/purescript/packages.el @@ -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! diff --git a/layers/+lang/python/packages.el b/layers/+lang/python/packages.el index ab3d7abc5ee0..8e87b5b207c3 100644 --- a/layers/+lang/python/packages.el +++ b/layers/+lang/python/packages.el @@ -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 @@ -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 diff --git a/layers/+lang/racket/packages.el b/layers/+lang/racket/packages.el index c1373fd2d3c5..d63ed84114c0 100644 --- a/layers/+lang/racket/packages.el +++ b/layers/+lang/racket/packages.el @@ -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 @@ -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 diff --git a/layers/+lang/ruby/packages.el b/layers/+lang/ruby/packages.el index c236ea7818f6..417072dddf2d 100644 --- a/layers/+lang/ruby/packages.el +++ b/layers/+lang/ruby/packages.el @@ -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) @@ -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 diff --git a/layers/+lang/scala/packages.el b/layers/+lang/scala/packages.el index eef0882ab01a..102c3698507c 100644 --- a/layers/+lang/scala/packages.el +++ b/layers/+lang/scala/packages.el @@ -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) @@ -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 diff --git a/layers/+lang/scheme/packages.el b/layers/+lang/scheme/packages.el index 44eb00a97857..e4a81f87c45d 100644 --- a/layers/+lang/scheme/packages.el +++ b/layers/+lang/scheme/packages.el @@ -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") @@ -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 diff --git a/layers/+lang/sml/packages.el b/layers/+lang/sml/packages.el index 9b0ae516d195..eb5c314984bf 100644 --- a/layers/+lang/sml/packages.el +++ b/layers/+lang/sml/packages.el @@ -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 () @@ -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 diff --git a/layers/+lang/sql/packages.el b/layers/+lang/sql/packages.el index 847ecf8e8ac0..b5553b4178e1 100644 --- a/layers/+lang/sql/packages.el +++ b/layers/+lang/sql/packages.el @@ -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 @@ -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