evil-mode improvement. separate some special mode
[dotfiles.git] / emacs.d / config.org
index 5012da6..f504edc 100644 (file)
@@ -422,6 +422,8 @@ clean mode line, Refer to [[https://www.masteringemacs.org/article/hiding-replac
       (irony-mode . "")
       (page-break-lines-mode . "")
       (yas-minor-mode . "y")
+      ;; default jj
+      (evil-escape-mode . "")
       ;; Major modes
       (lisp-interaction-mode . "λ")
       (hi-lock-mode . "")
@@ -545,6 +547,7 @@ Revised powerline-center-theme
                                        ))
                             (center (list (powerline-raw " " face1)
                                           (funcall separator-left face1 face2)
+                                          (powerline-raw (when  (and (boundp 'evil-mode)  evil-mode) evil-mode-line-tag) face2)
                                           (when (and (boundp 'erc-track-minor-mode) erc-track-minor-mode)
                                             (powerline-raw erc-modified-channels-object face2 'l))
                                           (powerline-major-mode face2 'l)
@@ -789,9 +792,7 @@ use [[https://github.com/sabof/org-bullets][org-bullets]] package to show utf-8
   (use-package org-bullets
     :ensure t
     :init
-    (add-hook 'org-mode-hook
-              (lambda ()
-                (org-bullets-mode t))))
+    (add-hook 'org-mode-hook (apply-partially #'org-bullets-mode t)))
 
   (setq org-bullets-bullet-list '("⦿" "✪" "◉" "○" "►" "◆"))
 
@@ -1256,8 +1257,9 @@ set default eshell history folder
 #+BEGIN_SRC emacs-lisp :tangle yes :results silent
   (require 'utilities)
 
-  (add-hook 'eshell-mode-hook (lambda ()
-                                (local-set-key (kbd "C-l") 'sd/eshell-clear-buffer)))
+  ;; (add-hook 'eshell-mode-hook (lambda ()
+  ;;                               (local-set-key (kbd "C-l") 'sd/eshell-clear-buffer)))
+  (add-hook 'eshell-mode-hook (apply-partially #'local-set-key (kbd "C-l") 'sd/eshell-clear-buffer))
 #+END_SRC
 
 ** Toggle Eshell
@@ -1482,10 +1484,10 @@ Type =o= to go to the link
 ** Which key
 [[https://github.com/justbur/emacs-which-key][which-key]] show the key bindings 
 #+BEGIN_SRC emacs-lisp :tangle yes :results silent
-  (use-package which-key
-    :ensure t
-    :config
-    (which-key-mode))
+  ;; (use-package which-key
+  ;;   :ensure t
+  ;;   :config
+  ;;   (which-key-mode))
 #+END_SRC
 
 ** View only for some directory
@@ -2114,9 +2116,7 @@ bindings in =lispy-mode-map= after loaded. see [[http://stackoverflow.com/questi
       (define-key lispy-mode-map (kbd "G") 'special-lispy-goto)
       (define-key lispy-mode-map (kbd "M-m") 'back-to-indentation))
     :config
-    (add-hook 'emacs-lisp-mode-hook (lambda () (lispy-mode 1))))
-
-
+    (add-hook 'emacs-lisp-mode-hook (apply-partially #'lispy-mode 1)))
 #+END_SRC
 
 ** Perl
@@ -2136,9 +2136,7 @@ bindings in =lispy-mode-map= after loaded. see [[http://stackoverflow.com/questi
   (setq cperl-tab-always-indent t)
   ;(setq cperl-brace-offset  0)
 
-  (add-hook 'cperl-mode-hook
-            '(lambda ()
-               (cperl-set-style "C++")))
+  (add-hook 'cperl-mode-hook (apply-partially #'cperl-set-style "C++"))
 
   (defalias 'perldoc 'cperl-perldoc)
 #+END_SRC
@@ -2674,8 +2672,9 @@ Then Run =M-x gnus=
   ;; (with-eval-after-load 'gnus-summary-mode
   ;;   (define-key gnus-summary-mode-map (kbd "C-o") 'sd/hydra-window/body))
 
-  (add-hook 'gnus-summary-mode-hook (lambda ()
-                                      (define-key gnus-summary-mode-map (kbd "C-o") nil)))
+  ;; (add-hook 'gnus-summary-mode-hook (lambda ()
+  ;;                                     (define-key gnus-summary-mode-map (kbd "C-o") nil)))
+  ;(add-hook 'gnus-summary-mode-hook (apply-partially #'define-key gnus-summary-mode-map (kbd "C-o") nil))
 
 
 #+END_SRC
@@ -3523,20 +3522,10 @@ Refer [[https://github.com/fnwiya/dotfiles/blob/c9ca79f1b22c919d9f4c3a0f944ba828
 #+END_SRC
 * Evil Mode
 #+BEGIN_SRC emacs-lisp :tangle yes :results silent
-  (use-package evil
-    :ensure t
-    :init
-    (setq evil-default-state 'emacs)
-    :config
-    (evil-mode t)
-    (defalias 'evil-insert-state 'evil-emacs-state)
-    (setq evil-emacs-state-cursor '("red" box))
-    (setq evil-normal-state-cursor '("green" box))
-    (setq evil-visual-state-cursor '("orange" box))
-    (setq evil-insert-state-cursor '("red" bar))
-    (setq evil-replace-state-cursor '("red" bar))
-    (setq evil-operator-state-cursor '("red" hollow)))
+  (org-babel-load-file "~/.emacs.d/emacs-evil.org")
 #+END_SRC
+
+
 * Note
 ** Check if emacs is in terminal of graphic mode
 Use =display-graphic-p= instead of =window-system=