   "Configuration options for evil-mode."
   :group 'dotemacs
   :prefix 'dotemacs-evil)
-
-(defcustom dotemacs-evil/evil-state-modes
-  '(fundamental-mode
-    conf-mode
-    message-mode
-    text-mode
-    prog-mode
-    css-mode
-    jsx-mode
-    sws-mode
-    yaml-mode
-    vimrc-mode
-    dired-mode
-    web-mode
-    magit-mode
-    log-edit-mode)
-  "List of modes that should start up in Evil state."
-  :type '(repeat (symbol))
-  :group 'dotemacs-evil)
 
 (defcustom dotemacs-evil/emacs-state-hooks
   '(org-log-buffer-setup-hook org-capture-mode-hook)

(require-package 'evil-numbers)


(defun my-major-mode-evil-state-adjust ()
  (if (apply 'derived-mode-p dotemacs-evil/evil-state-modes)
      (turn-on-evil-mode)
    (set-cursor-color dotemacs-evil/emacs-cursor)
    (turn-off-evil-mode)))
(add-hook 'after-change-major-mode-hook #'my-major-mode-evil-state-adjust)

(cl-loop for mode in dotemacs-evil/emacs-state-minor-modes
         do (let ((hook (concat (symbol-name mode) "-hook")))
              (add-hook (intern hook) `(lambda ()
                                         (if ,mode
                                             (evil-emacs-state)
                                           (evil-normal-state))))))

(cl-loop for hook in dotemacs-evil/emacs-state-hooks
         do (add-hook hook #'evil-emacs-state))


(defun my-send-string-to-terminal (string)
  (unless (display-graphic-p) (send-string-to-terminal string)))


  :type '(repeat (symbol))
  :group 'dotemacs-evil)

(defcustom dotemacs-evil/emacs-state-major-modes
  '(eshell-mode
    help-mode
    term-mode
    paradox-menu-mode
    makey-key-mode)
  "List of major modes that should default to Emacs state."
  :type '(repeat (symbol))
  :group 'dotemacs-evil)

(defcustom dotemacs-evil/emacs-state-minor-modes
  '(edebug-mode
    git-commit-mode
    magit-blame-mode)
  "List of minor modes that when active should switch to Emacs state."
  :type '(repeat (symbol))
  :group 'dotemacs-evil)
