2015-07-11 01:32:10 +00:00
|
|
|
;;; packages.el --- Scheme Layer packages File for Spacemacs
|
|
|
|
;;
|
2021-03-22 20:11:29 +00:00
|
|
|
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
|
2015-07-11 01:32:10 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
2021-03-24 03:31:44 +00:00
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
;;
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
;;
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2015-07-11 01:32:10 +00:00
|
|
|
|
2021-04-14 15:40:19 +00:00
|
|
|
(defconst scheme-packages
|
|
|
|
'(company
|
|
|
|
evil-cleverparens
|
|
|
|
geiser
|
|
|
|
ggtags
|
|
|
|
counsel-gtags
|
|
|
|
helm-gtags
|
|
|
|
(geiser-chez :toggle (memq 'chez scheme-implementations))
|
|
|
|
(geiser-chibi :toggle (memq 'chibi scheme-implementations))
|
|
|
|
(geiser-chicken :toggle (memq 'chicken scheme-implementations))
|
|
|
|
(geiser-gambit :toggle (memq 'gambit scheme-implementations))
|
|
|
|
(geiser-gauche :toggle (memq 'gauche scheme-implementations))
|
|
|
|
(geiser-guile :toggle (memq 'guile scheme-implementations))
|
|
|
|
(geiser-kawa :toggle (memq 'kawa scheme-implementations))
|
|
|
|
(geiser-mit :toggle (memq 'mit scheme-implementations))
|
|
|
|
(geiser-racket :toggle (memq 'racket scheme-implementations))))
|
|
|
|
|
2016-05-30 02:39:21 +00:00
|
|
|
|
|
|
|
(defun scheme/post-init-company ()
|
|
|
|
;; Geiser provides completion as long as company mode is loaded.
|
2021-04-24 09:47:35 +00:00
|
|
|
(spacemacs|add-company-backends :modes scheme-mode :backends geiser-company-backend))
|
2015-07-11 01:32:10 +00:00
|
|
|
|
2018-01-04 06:34:23 +00:00
|
|
|
(defun scheme/pre-init-evil-cleverparens ()
|
|
|
|
(spacemacs|use-package-add-hook evil-cleverparens
|
|
|
|
:pre-init
|
|
|
|
(add-to-list 'evil-lisp-safe-structural-editing-modes 'scheme-mode)))
|
|
|
|
|
2015-07-11 01:32:10 +00:00
|
|
|
(defun scheme/init-geiser ()
|
|
|
|
(use-package geiser
|
|
|
|
:commands run-geiser
|
2021-04-26 13:42:48 +00:00
|
|
|
:init (spacemacs/register-repl 'geiser 'run-geiser "geiser")
|
2015-07-11 01:32:10 +00:00
|
|
|
:config
|
|
|
|
(progn
|
2017-01-02 05:39:04 +00:00
|
|
|
;; prefixes
|
2015-11-28 20:13:10 +00:00
|
|
|
(spacemacs/declare-prefix-for-mode 'scheme-mode "mc" "compiling")
|
|
|
|
(spacemacs/declare-prefix-for-mode 'scheme-mode "mg" "navigation")
|
|
|
|
(spacemacs/declare-prefix-for-mode 'scheme-mode "mh" "documentation")
|
|
|
|
(spacemacs/declare-prefix-for-mode 'scheme-mode "mi" "insertion")
|
|
|
|
(spacemacs/declare-prefix-for-mode 'scheme-mode "mm" "macroexpansion")
|
|
|
|
(spacemacs/declare-prefix-for-mode 'scheme-mode "ms" "repl")
|
2017-01-02 05:39:04 +00:00
|
|
|
;; key bindings
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'scheme-mode
|
2016-01-26 16:31:15 +00:00
|
|
|
"'" 'geiser-mode-switch-to-repl
|
2015-11-12 20:07:02 +00:00
|
|
|
"," 'lisp-state-toggle-lisp-state
|
|
|
|
|
2015-11-18 00:38:05 +00:00
|
|
|
"cc" 'geiser-compile-current-buffer
|
|
|
|
"cp" 'geiser-add-to-load-path
|
|
|
|
|
2015-11-12 20:07:02 +00:00
|
|
|
"eb" 'geiser-eval-buffer
|
|
|
|
"ee" 'geiser-eval-last-sexp
|
|
|
|
"ef" 'geiser-eval-definition
|
|
|
|
"el" 'lisp-state-eval-sexp-end-of-line
|
2015-11-27 04:34:11 +00:00
|
|
|
"er" 'geiser-eval-region
|
2015-11-12 20:07:02 +00:00
|
|
|
|
2015-11-18 00:38:05 +00:00
|
|
|
"gm" 'geiser-edit-module
|
|
|
|
"gn" 'next-error
|
|
|
|
"gN" 'previous-error
|
|
|
|
|
|
|
|
"hh" 'geiser-doc-symbol-at-point
|
|
|
|
"hd" 'geiser-doc-look-up-manual
|
|
|
|
"hm" 'geiser-doc-module
|
|
|
|
"h<" 'geiser-xref-callers
|
|
|
|
"h>" 'geiser-xref-callees
|
|
|
|
|
|
|
|
"il" 'geiser-insert-lambda
|
|
|
|
|
|
|
|
"me" 'geiser-expand-last-sexp
|
|
|
|
"mf" 'geiser-expand-definition
|
2021-05-26 19:49:06 +00:00
|
|
|
"mr" 'geiser-expand-region
|
2015-11-18 00:38:05 +00:00
|
|
|
|
|
|
|
"si" 'geiser-mode-switch-to-repl
|
|
|
|
"sb" 'geiser-eval-buffer
|
|
|
|
"sB" 'geiser-eval-buffer-and-go
|
|
|
|
"sf" 'geiser-eval-definition
|
|
|
|
"sF" 'geiser-eval-definition-and-go
|
|
|
|
"se" 'geiser-eval-last-sexp
|
|
|
|
"sr" 'geiser-eval-region
|
2015-11-10 02:08:49 +00:00
|
|
|
"sR" 'geiser-eval-region-and-go
|
2021-04-26 13:42:48 +00:00
|
|
|
"ss" 'geiser-set-scheme)
|
|
|
|
|
2021-06-22 15:29:02 +00:00
|
|
|
(evil-define-key 'insert geiser-repl-mode-map
|
2021-05-26 19:49:06 +00:00
|
|
|
(kbd "S-<return>") 'geiser-repl--newline-and-indent
|
|
|
|
(kbd "C-l") 'geiser-repl-clear-buffer
|
|
|
|
(kbd "C-d") 'geiser-repl-exit)
|
|
|
|
|
2021-06-22 15:29:02 +00:00
|
|
|
(evil-define-key 'normal geiser-repl-mode-map
|
2021-05-26 19:49:06 +00:00
|
|
|
"]]" 'geiser-repl-next-prompt
|
|
|
|
"[[" 'geiser-repl-previous-prompt
|
|
|
|
"gj" 'geiser-repl-next-prompt
|
|
|
|
"gk" 'geiser-repl-previous-prompt)
|
2021-04-26 13:42:48 +00:00
|
|
|
|
2021-05-26 19:49:06 +00:00
|
|
|
(spacemacs/declare-prefix-for-mode 'geiser-repl-mode "mh" "help")
|
|
|
|
(spacemacs/declare-prefix-for-mode 'geiser-repl-mode "mi" "insert")
|
2021-04-26 13:42:48 +00:00
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'geiser-repl-mode
|
2021-05-26 19:49:06 +00:00
|
|
|
"C" 'geiser-repl-clear-buffer
|
|
|
|
"k" 'geiser-repl-interrupt
|
|
|
|
"f" 'geiser-load-file
|
|
|
|
"il" 'geiser-insert-lambda
|
|
|
|
"im" 'geiser-repl-import-module
|
2021-04-26 13:42:48 +00:00
|
|
|
"u" 'geiser-repl-unload-function
|
2021-05-26 19:49:06 +00:00
|
|
|
"hh" 'geiser-doc-symbol-at-point
|
|
|
|
"s" 'geiser-squarify
|
|
|
|
"q" 'geiser-repl-exit)
|
|
|
|
|
|
|
|
(evilified-state-evilify-map geiser-doc-mode-map
|
|
|
|
:mode geiser-doc-mode
|
|
|
|
:eval-after-load geiser-doc
|
|
|
|
:bindings
|
|
|
|
"o" 'link-hint-open-link
|
|
|
|
|
|
|
|
"]]" 'geiser-doc-next-section
|
|
|
|
"[[" 'geiser-doc-previous-section
|
|
|
|
">" 'geiser-doc-next
|
|
|
|
"<" 'geiser-doc-previous
|
|
|
|
|
|
|
|
"gp" 'geiser-doc-previous
|
|
|
|
"gn" 'geiser-doc-next
|
|
|
|
"gz" 'geiser-doc-switch-to-repl
|
|
|
|
(kbd "C-j") 'forward-button
|
|
|
|
(kbd "C-k") 'backward-button))))
|
2016-04-05 04:08:34 +00:00
|
|
|
|
|
|
|
(defun scheme/post-init-ggtags ()
|
2016-08-15 19:24:44 +00:00
|
|
|
(add-hook 'scheme-mode-local-vars-hook #'spacemacs/ggtags-mode-enable))
|
2016-04-05 04:08:34 +00:00
|
|
|
|
2017-08-26 21:18:09 +00:00
|
|
|
(defun scheme/post-init-counsel-gtags ()
|
|
|
|
(spacemacs/counsel-gtags-define-keys-for-mode 'scheme-mode))
|
|
|
|
|
2016-04-05 04:08:34 +00:00
|
|
|
(defun scheme/post-init-helm-gtags ()
|
|
|
|
(spacemacs/helm-gtags-define-keys-for-mode 'scheme-mode))
|
2017-05-29 09:35:22 +00:00
|
|
|
|
2021-04-14 15:40:19 +00:00
|
|
|
(defun scheme/init-geiser-chez ()
|
|
|
|
(use-package geiser-chez
|
|
|
|
:defer t))
|
|
|
|
|
|
|
|
(defun scheme/init-geiser-chibi ()
|
|
|
|
(use-package geiser-chibi
|
|
|
|
:defer t))
|
|
|
|
|
|
|
|
(defun scheme/init-geiser-chicken ()
|
|
|
|
(use-package geiser-chicken
|
|
|
|
:defer t))
|
|
|
|
|
|
|
|
(defun scheme/init-geiser-gambit ()
|
|
|
|
(use-package geiser-gambit
|
|
|
|
:defer t))
|
|
|
|
|
|
|
|
(defun scheme/init-geiser-gauche ()
|
|
|
|
(use-package geiser-gauche
|
|
|
|
:defer t))
|
|
|
|
|
|
|
|
(defun scheme/init-geiser-guile ()
|
|
|
|
(use-package geiser-guile
|
|
|
|
:defer t))
|
|
|
|
|
|
|
|
(defun scheme/init-geiser-kawa ()
|
|
|
|
(use-package geiser-kawa
|
|
|
|
:defer t))
|
|
|
|
|
|
|
|
(defun scheme/init-geiser-mit ()
|
|
|
|
(use-package geiser-mit
|
|
|
|
:defer t))
|
|
|
|
|
|
|
|
(defun scheme/init-geiser-racket ()
|
|
|
|
(use-package geiser-racket
|
|
|
|
:defer t))
|