Polish modeline
This commit is contained in:
parent
db19a6d251
commit
96efdc2c0b
2 changed files with 25 additions and 20 deletions
|
@ -177,10 +177,15 @@
|
||||||
;; Mode-line ;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; Mode-line ;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(use-package spaceline-segments
|
(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
|
:config
|
||||||
(setq-default
|
(setq-default
|
||||||
powerline-default-separator nil
|
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-is-modified nil "Face for mode-line modified symbol")
|
||||||
(defface mode-line-buffer-file nil "Face for mode-line buffer file path")
|
(defface mode-line-buffer-file nil "Face for mode-line buffer file path")
|
||||||
|
@ -202,7 +207,7 @@
|
||||||
buffer-path)))
|
buffer-path)))
|
||||||
"%b")
|
"%b")
|
||||||
:face (if active 'mode-line-buffer-file 'mode-line-inactive)
|
:face (if active 'mode-line-buffer-file 'mode-line-inactive)
|
||||||
:tight-right t)
|
:tight t)
|
||||||
|
|
||||||
(spaceline-define-segment narf-buffer-modified
|
(spaceline-define-segment narf-buffer-modified
|
||||||
(concat
|
(concat
|
||||||
|
@ -238,12 +243,6 @@
|
||||||
(t "")))))
|
(t "")))))
|
||||||
:when (and active vc-mode))
|
: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
|
(spaceline-define-segment narf-env-version
|
||||||
"A HUD that shows which part of the buffer is currently visible."
|
"A HUD that shows which part of the buffer is currently visible."
|
||||||
(when (and narf--env-command (not narf--env-version))
|
(when (and narf--env-command (not narf--env-version))
|
||||||
|
@ -262,14 +261,17 @@ to be enabled."
|
||||||
(let ((here anzu--current-position)
|
(let ((here anzu--current-position)
|
||||||
(total anzu--total-matched))
|
(total anzu--total-matched))
|
||||||
(when anzu--state
|
(when anzu--state
|
||||||
|
(concat
|
||||||
|
(propertize
|
||||||
(cl-case anzu--state
|
(cl-case anzu--state
|
||||||
(search (format " %s/%d%s "
|
(search (format " %s/%d%s "
|
||||||
(anzu--format-here-position here total)
|
(anzu--format-here-position here total)
|
||||||
total (if anzu--overflow-p "+" "")))
|
total (if anzu--overflow-p "+" "")))
|
||||||
(replace-query (format " %d replace " total))
|
(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))
|
:when (and active (bound-and-true-p anzu--state))
|
||||||
:face highlight-face
|
|
||||||
:tight t)
|
:tight t)
|
||||||
|
|
||||||
;; Initialize modeline
|
;; Initialize modeline
|
||||||
|
@ -284,12 +286,11 @@ to be enabled."
|
||||||
'((selection-info :face highlight-face)
|
'((selection-info :face highlight-face)
|
||||||
narf-env-version
|
narf-env-version
|
||||||
narf-buffer-encoding-abbrev
|
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 "")
|
(minor-modes :tight t :separator "")
|
||||||
process :when active)
|
process :when active)
|
||||||
(global :when active)
|
(global :when active)
|
||||||
("%l/%c" narf-buffer-position)
|
("%l·%c" narf-buffer-position)
|
||||||
narf-hud
|
|
||||||
)))
|
)))
|
||||||
|
|
||||||
(provide 'core-ui)
|
(provide 'core-ui)
|
||||||
|
|
|
@ -97,14 +97,18 @@
|
||||||
`(linum-highlight-face ((,class (:inherit linum :background ,current-line :foreground ,linum-highlight))))
|
`(linum-highlight-face ((,class (:inherit linum :background ,current-line :foreground ,linum-highlight))))
|
||||||
`(show-paren-match ((,class (:foreground ,highlight :weight ultra-bold))))
|
`(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-active1 ((,class (:foreground ,subtle :background ,modeline-bg-light))))
|
||||||
`(powerline-active2 ((,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-is-modified ((,class (:foreground ,highlight))))
|
||||||
`(mode-line-buffer-file ((,class (:foreground ,off-white))))
|
`(mode-line-buffer-file ((,class (:foreground ,off-white))))
|
||||||
`(mode-line-buffer-dir ((,class (:foreground ,subtle))))
|
`(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-inactive1 ((,class (:foreground ,vsubtle :background ,modeline-bg-inactive))))
|
||||||
`(powerline-inactive2 ((,class (:foreground ,vsubtle :background ,modeline-bg-inactive))))
|
`(powerline-inactive2 ((,class (:foreground ,vsubtle :background ,modeline-bg-inactive))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue