summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck.cuny@gmail.com>2016-11-26 17:44:20 -0800
committerFranck Cuny <franck.cuny@gmail.com>2016-11-26 17:44:20 -0800
commit46b961ff054c6c6d63a0775a58d8e299d37d6c2a (patch)
tree1c6e2211edfccdd325a821ed65d176d62cad279b
parent[tmux] simplify tmux as much as possible. (diff)
downloademacs.d-46b961ff054c6c6d63a0775a58d8e299d37d6c2a.tar.gz
[Emacs] Simplify the mode-line by using only powerline.
Simplify the configuration for flycheck too.
-rw-r--r--emacs.d/init.el66
1 files changed, 9 insertions, 57 deletions
diff --git a/emacs.d/init.el b/emacs.d/init.el
index f3fd673..39afd33 100644
--- a/emacs.d/init.el
+++ b/emacs.d/init.el
@@ -185,25 +185,7 @@
                        (warning line-start (id (1+ nonl)) ":WARNING" (1+ nonl) ":" line (message) line-end))
       :predicate check-source-predicate
       :modes (python-mode))
-    (add-to-list 'flycheck-checkers 'source-check)
-
-    (defun fc/flycheck-modeline (errors-count warnings-count info-count)
-      (concat
-       (propertize (format "•%s " errors-count)   'face '(:foreground "#A20C41"))
-       (propertize (format "•%s " warnings-count) 'face '(:foreground "#968B26"))
-       (propertize (format "•%s " info-count)     'face '(:foreground "#21889B"))))
-
-    (setq flycheck-mode-line
-          '(:eval
-            (pcase flycheck-last-status-change
-              (`finished
-               (let* ((count (flycheck-count-errors flycheck-current-errors))
-                      (errors-count (cdr (assq 'error count)))
-                      (warnings-count (cdr (assq 'warning count)))
-                      (info-count (cdr (assq 'info count))))
-                 (fc/flycheck-modeline (or errors-count 0) (or warnings-count 0) (or info-count 0))))
-              ;; the default is to show ? for the count
-              (_ (fc/flycheck-modeline "?" "?" "?")))))))
+    (add-to-list 'flycheck-checkers 'source-check)))
 
 (use-package flyspell
   ;; check the spelling
@@ -405,6 +387,14 @@
   :config
   (setq diffusion-repo-prefix-list '(("source" "source"))))
 
+(use-package powerline
+  ;; nicer modeline
+  :config
+  (setq powerline-display-buffer-size nil)
+  (setq powerline-display-mule-info nil)
+  (setq powerline-display-hud nil)
+  (powerline-default-theme))
+
 (use-package projectile
   ;; library to interact with projects
   :ensure t
@@ -471,44 +461,6 @@
           sh-indentation 2))
   (add-hook 'sh-mode-hook 'set-sh-mode-indent)
   (add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p))
-(use-package spaceline
-  ;; configure the modeline
-  :ensure t)
-
-(use-package spaceline-config
-  ;; configuration for the modeline
-  :ensure nil
-  :after spaceline
-
-  :config
-  ;; colors
-  (set-face-attribute 'powerline-active1 nil :background "grey22" :foreground "white" :inherit `mode-line)
-  (set-face-attribute 'powerline-active2 nil :background "grey40" :foreground "white" :inherit `mode-line)
-  (set-face-attribute 'powerline-inactive1 nil :background "grey22" :foreground "white" :inherit `mode-line-inactive)
-  (set-face-attribute 'powerline-inactive2 nil :background "grey40" :foreground "white" :inherit `mode-line-inactive)
-  (set-face-attribute (spaceline-highlight-face-default) nil :background "grey22" :foreground "white" :inherit `mode-line)
-
-  (setq-default powerline-default-separator 'arrow)
-
-  (spaceline-define-segment line-column
-      "The current line and column numbers."
-      "%2l : %2c")
-
-  (spaceline-define-segment time
-    "The current time."
-    (format-time-string "%H:%M"))
-
-  (spaceline-toggle-time-on)
-  (spaceline-toggle-buffer-encoding-abbrev-off)
-  (spaceline-toggle-flycheck-warning-off)
-  (spaceline-toggle-flycheck-error-off)
-  (spaceline-toggle-flycheck-info-off)
-  (spaceline-toggle-buffer-modified-on)
-  (spaceline-toggle-buffer-size-off)
-  (spaceline-toggle-buffer-position-off)
-  (spaceline-toggle-hud-off)
-  (spaceline-emacs-theme 'projectile-root 'time))
-
 
 (use-package swiper
   ;; install swiper