From 46b961ff054c6c6d63a0775a58d8e299d37d6c2a Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sat, 26 Nov 2016 17:44:20 -0800 Subject: [Emacs] Simplify the mode-line by using only powerline. Simplify the configuration for flycheck too. --- emacs.d/init.el | 66 ++++++++------------------------------------------------- 1 file 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 -- cgit 1.4.1