Eshell: Set helm-eshell-switch conditionally

master
Pierre Neidhardt 2019-03-03 11:38:22 +01:00
parent 6f63408a16
commit da2d750ec3
2 changed files with 14 additions and 13 deletions

View File

@ -257,17 +257,16 @@ This should be faster then `seq-uniq'."
;; (add-hook 'eshell-mode-hook 'ambrevar/fix-local-epa-file-encrypt-to) ;; (add-hook 'eshell-mode-hook 'ambrevar/fix-local-epa-file-encrypt-to)
;;; Spawning ;;; Spawning
(require 'patch-helm) (when (require 'patch-helm nil 'noerror)
(helm-defswitcher
(helm-defswitcher "Eshell"
"Eshell" (lambda (b)
(lambda (b) (with-current-buffer b
(with-current-buffer b (derived-mode-p 'eshell-mode)))
(derived-mode-p 'eshell-mode))) (lambda (&optional name)
(lambda (&optional name) (eshell 'new)
(eshell 'new) (when name
(when name (rename-buffer (format "*eshell<%s>*" name) 'unique)))))
(rename-buffer (format "*eshell<%s>*" name) 'unique))))
;;; Auto-suggestion ;;; Auto-suggestion
(when (require 'esh-autosuggest nil t) (when (require 'esh-autosuggest nil t)

View File

@ -80,8 +80,10 @@
;;; Emacs mode shortcuts. ;;; Emacs mode shortcuts.
(exwm-input-set-key (kbd "s-t") #'ambrevar/org-switch-agenda-file) (exwm-input-set-key (kbd "s-t") #'ambrevar/org-switch-agenda-file)
(exwm-input-set-key (kbd "s-T") #'ambrevar/org-switch-agenda-file-other-window) (exwm-input-set-key (kbd "s-T") #'ambrevar/org-switch-agenda-file-other-window)
(exwm-input-set-key (kbd "s-<return>") #'helm-eshell-switch) (if (not (fboundp 'helm-eshell-switch))
(exwm-input-set-key (kbd "S-s-<return>") #'helm-eshell-switch-other-window) (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 (with-eval-after-load 'slime
(exwm-input-set-key (kbd "s-<backspace>") #'ambrevar/slime-switch-to-repl)) (exwm-input-set-key (kbd "s-<backspace>") #'ambrevar/slime-switch-to-repl))
(when (fboundp 'magit-status) (when (fboundp 'magit-status)