EXWM: Bind s-C-backspace to repl-switcher

master
Pierre Neidhardt 2019-03-24 09:11:46 +01:00
parent 2a46e7ee9f
commit 6165dc4d5c
1 changed files with 14 additions and 5 deletions

View File

@ -86,11 +86,6 @@
(exwm-input-set-key (kbd "s-<return>") #'eshell)
(exwm-input-set-key (kbd "s-<return>") #'helm-eshell-switch)
(exwm-input-set-key (kbd "S-s-<return>") #'helm-eshell-switch-other-window))
(with-eval-after-load 'slime
(exwm-input-set-key (kbd "s-<backspace>") #'ambrevar/slime-switch-to-repl))
(with-eval-after-load 'geiser-impl
(exwm-input-set-key (kbd "s-<backspace>") #'helm-geiser-repl-switch)
(exwm-input-set-key (kbd "S-s-<backspace>") #'helm-geiser-repl-switch-other-window))
(when (fboundp 'magit-status)
(exwm-input-set-key (kbd "s-v") #'magit-status))
(when (fboundp 'emms-all)
@ -121,6 +116,20 @@
(when (fboundp 'helm-pass)
(exwm-input-set-key (kbd "s-p") #'helm-pass))
(defun ambrevar/repl-switcher ()
"Switch between Geiser and SLIME REPLs."
(interactive)
(pcase
(completing-read "Lisp: " '(geiser slime))
("geiser"
(autoload 'helm-geiser-repl-switch "scheme")
(exwm-input-set-key (kbd "s-<backspace>") #'helm-geiser-repl-switch)
(exwm-input-set-key (kbd "S-s-<backspace>") #'helm-geiser-repl-switch-other-window))
("slime"
(autoload 'ambrevar/slime-to-repl "lisp")
(exwm-input-set-key (kbd "s-<backspace>") #'ambrevar/slime-switch-to-repl))))
(exwm-input-set-key (kbd "s-C-<backspace>") #'ambrevar/repl-switcher)
;;; External application shortcuts.
(defun ambrevar/exwm-start (command)
(interactive (list (read-shell-command "$ ")))