   (message "tslint --fixing the file" (buffer-file-name))
   (call-process-shell-command (concat "tslint --fix --config " (projectile-project-root) "tslint.json " (buffer-file-name) " &") nil 0))
   ;; (revert-buffer t t))
+;;; eshell helper functions
+(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))
+(defun ab/new-eshell ()
+  "create a new eshell"
+  (interactive)
+  (if (projectile-project-root)
+      (projectile-run-eshell 'N)
+    (eshell 'N)))
+(defun ab/new-eshell-in-split ()
+  "create a new eshell in new split
+if in eshell already, create a vertical split
+otherwise create a horizontal split"
+  (interactive)
+  (if (derived-mode-p 'eshell-mode)
+      (ab/window-split-down)
+    (ab/window-split-right))
+  (ab/new-eshell))
+;;; found at https://stackoverflow.com/a/59236830
+(defun ab/eshell-prompt-function ()
+  (setq eshell-prompt-regexp "^λ: ")
+  (format "%s\nλ: " (abbreviate-file-name (eshell/pwd))))
+(defun ab/eshell-kill-window-on-exit ()
+  "delete window when eshell is terminated
+as long as the window is not the only window"
+  (when (not (one-window-p))
+    (delete-window)))
 
 ;; Toggle Window Maximize
 ;; Credit: https://github.com/hlissner/doom-emacs/blob/59a6cb72be1d5f706590208d2ca5213f5a837deb/core/autoload/ui.el#L106



;;; 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

(global-set-key (kbd "<f6>") 'ivy-resume)
(define-key ivy-minibuffer-map (kbd "C-j") 'ivy-next-line)
(define-key ivy-minibuffer-map (kbd "C-k") 'ivy-previous-line)
;; eshell terminal bindings
(global-set-key (kbd "C-`") 'ab/new-eshell-in-split)
(global-set-key (kbd "C-~") 'ab/new-eshell)

;; autocomplete
(use-package company
