 ;; binding only works by using hook
 (defun bind-eshell-keys()
   (evil-define-key 'normal eshell-mode-map (kbd "C-n") nil)
-  (evil-collection-define-key 'normal 'eshell-mode-map (kbd "C-n") nil))
+  (evil-define-key 'normal eshell-mode-map (kbd "i") 'ab/eshell-insert-mode)
+  (evil-collection-define-key 'normal 'eshell-mode-map (kbd "C-n") nil)
+  (evil-collection-define-key 'insert 'eshell-mode-map (kbd "C-n") nil))
 (add-hook 'eshell-mode-hook 'bind-eshell-keys)
-
 
 ;; key bindings
 (define-key evil-normal-state-map (kbd ", SPC") 'evil-ex-nohighlight)

  :ensure t
  :config
  (setq doom-modeline-icon nil)
  :hook (after-init . doom-modeline-mode))
(use-package modus-operandi-theme
  :ensure t

;;; use 4 tab space
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)


;;; customize eshell prompt
;;; found at https://stackoverflow.com/a/59236830
(defun ab/eshell-prompt-function ()
  (setq eshell-prompt-regexp "^λ: ")
  (format "%s\nλ: " (abbreviate-file-name (eshell/pwd))))
(setq eshell-prompt-function #'ab/eshell-prompt-function)
(setq comint-prompt-read-only t)
(setq eshell-scroll-to-bottom-on-input t)
(defun ab/eshell-insert-mode ()
  "jump to end of buffer i.e. the prompt before switching to insert mode"
  (interactive)
  (end-of-buffer)
  (end-of-line)
  (evil-insert-state))

;;; Projectile
(use-package projectile
