Polish modeline

This commit is contained in:
Henrik Lissner 2015-11-07 00:20:04 -05:00
parent db19a6d251
commit 96efdc2c0b
2 changed files with 25 additions and 20 deletions

View file

@ -177,10 +177,15 @@
;; Mode-line ;;;;;;;;;;;;;;;;;;;;;;;;;;;
(use-package spaceline-segments
:init
(defvar narf--env-version nil)
(defvar narf--env-command nil)
(make-variable-buffer-local 'narf--env-version)
(make-variable-buffer-local 'narf--env-command)
:config
(setq-default
powerline-default-separator nil
powerline-height 18)
powerline-height 20)
(defface mode-line-is-modified nil "Face for mode-line modified symbol")
(defface mode-line-buffer-file nil "Face for mode-line buffer file path")
@ -202,7 +207,7 @@
buffer-path)))
"%b")
:face (if active 'mode-line-buffer-file 'mode-line-inactive)
:tight-right t)
:tight t)
(spaceline-define-segment narf-buffer-modified
(concat
@ -238,12 +243,6 @@
(t "")))))
:when (and active vc-mode))
;; Display version string
(defvar narf--env-version nil)
(defvar narf--env-command nil)
(make-variable-buffer-local 'narf--env-version)
(make-variable-buffer-local 'narf--env-command)
(spaceline-define-segment narf-env-version
"A HUD that shows which part of the buffer is currently visible."
(when (and narf--env-command (not narf--env-version))
@ -262,14 +261,17 @@ to be enabled."
(let ((here anzu--current-position)
(total anzu--total-matched))
(when anzu--state
(concat
(propertize
(cl-case anzu--state
(search (format " %s/%d%s "
(anzu--format-here-position here total)
total (if anzu--overflow-p "+" "")))
(replace-query (format " %d replace " total))
(replace (format " %d/%d " here total)))))
(replace (format " %d/%d " here total)))
'face highlight-face)
" ")))
:when (and active (bound-and-true-p anzu--state))
:face highlight-face
:tight t)
;; Initialize modeline
@ -284,12 +286,11 @@ to be enabled."
'((selection-info :face highlight-face)
narf-env-version
narf-buffer-encoding-abbrev
((major-mode :face (if active 'mode-line-buffer-file 'mode-line-inactive))
((major-mode :face (if active 'mode-line-buffer-file 'mode-line-inactive) :tight t)
(minor-modes :tight t :separator "")
process :when active)
(global :when active)
("%l/%c" narf-buffer-position)
narf-hud
("%l·%c" narf-buffer-position)
)))
(provide 'core-ui)

View file

@ -97,14 +97,18 @@
`(linum-highlight-face ((,class (:inherit linum :background ,current-line :foreground ,linum-highlight))))
`(show-paren-match ((,class (:foreground ,highlight :weight ultra-bold))))
`(mode-line ((,class (:foreground ,subtle :background ,modeline-bg-light))))
`(mode-line ((,class (:foreground ,subtle :background ,modeline-bg-light
:box (:line-width 2 :color ,modeline-bg-light)
))))
`(powerline-active1 ((,class (:foreground ,subtle :background ,modeline-bg-light))))
`(powerline-active2 ((,class (:foreground ,subtle :background ,modeline-bg-light))))
`(mode-line-is-modified ((,class (:foreground ,highlight))))
`(mode-line-buffer-file ((,class (:foreground ,off-white))))
`(mode-line-buffer-dir ((,class (:foreground ,subtle))))
`(mode-line-inactive ((,class (:foreground ,vsubtle :background ,modeline-bg-inactive))))
`(mode-line-inactive ((,class (:foreground ,vsubtle :background ,modeline-bg-inactive
:box (:line-width 2 :color ,modeline-bg-inactive)
))))
`(powerline-inactive1 ((,class (:foreground ,vsubtle :background ,modeline-bg-inactive))))
`(powerline-inactive2 ((,class (:foreground ,vsubtle :background ,modeline-bg-inactive))))