 (setq eshell-scroll-to-bottom-on-input t)
 ;;; terminate eshell window on exit
 (advice-add 'eshell-life-is-too-much :after 'ab/eshell-kill-window-on-exit)
+;;; customize eshell mode with configs and custom keybindings
+(add-hook 'eshell-mode-hook 'ab/eshell-mode-config)
+
 
 ;;; Projectile
 (use-package projectile

(define-key evil-motion-state-map (kbd "C-n") nil)
(global-set-key (kbd "C-n") nil)
(global-set-key (kbd "<normal-state> C-n") nil)
;; eshell is somehow notorious and refusing to release C-n
;; binding only works by using hook
(defun bind-eshell-keys()
  (evil-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)

(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)

;;; Magit
;; getting errors until I installed magit-popup and with-editor
(use-package magit-popup ; make sure it is installed
