     (beginning-of-line)
     (eshell-next-prompt 1)))
 
-(defun evil-eshell-setup ()
+(defun evil-eshell-next-prompt-on-insert ()
   (dolist (hook '(evil-replace-state-entry-hook evil-insert-state-entry-hook))
     (add-hook hook 'evil-eshell-next-prompt nil t)))
-
-(add-hook 'eshell-mode-hook 'evil-eshell-setup)
 
 (defun evil-eshell-interrupt-process ()
   (interactive)


;; TODO: Compare this setup procedure with evil-ediff.
(defun evil-eshell-setup ()
  (add-hook 'eshell-first-time-mode-hook 'evil-eshell-setup-function))

(provide 'evil-eshell)
;;; evil-eshell.el ends here


;;; `eshell-mode-map' is reset when Eshell is initialized in `eshell-mode'. We
;;; need to add bindings to `eshell-first-time-mode-hook'.
(defun evil-eshell-setup-keys ()
  (evil-define-key 'normal eshell-mode-map
    ;; motion
    "[" 'eshell-previous-prompt
