Better move-to-prompt-on-insert-mode hook for eshell

This commit is contained in:
Henrik Lissner 2018-05-26 18:58:00 +02:00
parent 177bf2a9de
commit c1c3a0987c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 18 additions and 0 deletions

View file

@ -44,6 +44,14 @@
(append eshell-visual-commands '("tmux" "htop" "bash" "zsh" "fish" "vim" "nvim"))
eshell-visual-subcommands '(("git" "log" "l" "diff" "show"))))
(defun +eshell|init-evil ()
"Replace `evil-collection-eshell-next-prompt-on-insert' with
`+eshell|goto-prompt-on-insert'."
(dolist (hook '(evil-replace-state-entry-hook evil-insert-state-entry-hook))
(remove-hook hook 'evil-collection-eshell-next-prompt-on-insert t)
(add-hook hook '+eshell|goto-prompt-on-insert nil t)))
(add-hook 'eshell-mode-hook #'+eshell|init-evil)
(defun +eshell|init-keymap ()
"Setup eshell keybindings. This must be done in a hook because eshell-mode
redefines its keys every time `eshell-mode' is enabled."