Emacs: Eshell: Document the conflict between eshell/alias and evil-define-key

master
Pierre Neidhardt 2017-06-18 21:25:56 +01:00
parent 848f68ab9e
commit c622bddbc2
2 changed files with 5 additions and 19 deletions

View File

@ -58,6 +58,9 @@
;;; `eshell/alias' is too slow as it reads and write the file on each definition.
;;; Let's write manually instead.
(with-eval-after-load 'em-alias
;;; TODO: This conflicts with `evil-define-key' during the initialization of
;;; the first eshell session: the map in insert-mode will not take the changes
;;; into account. Going to normal mode and back to insert mode works.
(eshell-read-aliases-list)
(dolist
(alias

View File

@ -218,24 +218,10 @@ See `eshell' for the numeric prefix arg."
;; TODO: Make Evil commands react more dynamically with read-only text.
;; Add support for I, C, D, S, s, c*, d*, R, r.
;; See https://github.com/emacs-evil/evil/issues/852
(defun evil/eshell-delete-whole-line ()
(interactive)
(if (not (get-text-property (line-beginning-position) 'read-only))
(evil-delete-whole-line (line-beginning-position) (line-end-position))
(eshell-return-to-prompt) ; Difference with eshell-bol?
(evil-delete-line (point) (line-end-position))))
;; (evil-define-key 'normal eshell-mode-map "dd" 'evil/eshell-delete-whole-line)
(defun evil/eshell-change-whole-line ()
(interactive)
(if (not (get-text-property (line-beginning-position) 'read-only))
(evil-change-whole-line (line-beginning-position) (line-end-position))
(eshell-return-to-prompt) ; Difference with eshell-bol?
(evil-change-line (point) (line-end-position))))
;; (evil-define-key 'normal eshell-mode-map "cc" 'evil/eshell-change-whole-line)
;; See https://github.com/emacs-evil/evil/issues/852.
;; Go-to-definition.
;; From https://emacs.stackexchange.com/questions/608/evil-map-keybindings-the-vim-way
;; From https://emacs.stackexchange.com/questions/608/evil-map-keybindings-the-vim-way.
(evil-global-set-key
'normal "gd"
(lambda () (interactive)
@ -249,9 +235,6 @@ See `eshell' for the numeric prefix arg."
(when (require 'evil-mc nil t)
(global-evil-mc-mode 1)
(define-key evil-mc-key-map (kbd "C-<mouse-1>") 'evil-mc-toggle-cursor-on-click)
;; Don't shadow evil's standard keys. TODO: Is \C-t ever needed? Evil's normal binding is `pop-tag-mark'.
;; (evil-define-key '(normal visual) evil-mc-key-map "\C-t" nil)
(set-face-attribute 'evil-mc-cursor-default-face nil :inherit nil :inverse-video nil :box "white")
(when (require 'evil-mc-extras nil t)
(global-evil-mc-extras-mode 1)))