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)
;;; Spawning
(require 'patch-helm)
(helm-defswitcher
"Eshell"
(lambda (b)
(with-current-buffer b
(derived-mode-p 'eshell-mode)))
(lambda (&optional name)
(eshell 'new)
(when name
(rename-buffer (format "*eshell<%s>*" name) 'unique))))
(when (require 'patch-helm nil 'noerror)
(helm-defswitcher
"Eshell"
(lambda (b)
(with-current-buffer b
(derived-mode-p 'eshell-mode)))
(lambda (&optional name)
(eshell 'new)
(when name
(rename-buffer (format "*eshell<%s>*" name) 'unique)))))
;;; Auto-suggestion
(when (require 'esh-autosuggest nil t)

View File

@ -80,8 +80,10 @@
;;; 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-other-window)
(exwm-input-set-key (kbd "s-<return>") #'helm-eshell-switch)
(exwm-input-set-key (kbd "S-s-<return>") #'helm-eshell-switch-other-window)
(if (not (fboundp 'helm-eshell-switch))
(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))
(when (fboundp 'magit-status)