Polish modeline
This commit is contained in:
parent
cb20d9f285
commit
ef251f8e44
1 changed files with 25 additions and 12 deletions
|
@ -286,21 +286,31 @@
|
||||||
|
|
||||||
(spaceline-define-segment narf-vc
|
(spaceline-define-segment narf-vc
|
||||||
"Version control info"
|
"Version control info"
|
||||||
(concat (downcase vc-mode)
|
(powerline-raw
|
||||||
(case (vc-state buffer-file-name)
|
(concat (replace-regexp-in-string
|
||||||
('edited "+")
|
(format "^ %s" (vc-backend buffer-file-name))
|
||||||
('conflict "!!!")
|
"" vc-mode)
|
||||||
(t "")))
|
(when buffer-file-name
|
||||||
|
(pcase (vc-state (buffer-file-name))
|
||||||
|
(`up-to-date "")
|
||||||
|
(`edited "*")
|
||||||
|
(`added "+")
|
||||||
|
(`unregistered "?")
|
||||||
|
(`removed "-")
|
||||||
|
(`needs-merge "%")
|
||||||
|
(`needs-update "^")
|
||||||
|
(`ignored "#")
|
||||||
|
(_ "_")))))
|
||||||
:when (and active vc-mode)
|
:when (and active vc-mode)
|
||||||
:face other-face
|
:face other-face
|
||||||
:tight t)
|
:tight-right t)
|
||||||
|
|
||||||
(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))
|
|
||||||
(narf|spaceline-env-update))
|
|
||||||
narf--env-version
|
narf--env-version
|
||||||
:when (and narf--env-version (memq major-mode '(ruby-mode enh-ruby-mode python-mode))))
|
:when narf--env-version
|
||||||
|
:skip-alternate t
|
||||||
|
:tight-right t)
|
||||||
|
|
||||||
(spaceline-define-segment narf-hud
|
(spaceline-define-segment narf-hud
|
||||||
"A HUD that shows which part of the buffer is currently visible."
|
"A HUD that shows which part of the buffer is currently visible."
|
||||||
|
@ -353,14 +363,17 @@ iedit."
|
||||||
(cons (line-beginning-position) (line-end-position))))
|
(cons (line-beginning-position) (line-end-position))))
|
||||||
(pattern (car-safe (evil-delimited-arguments evil-ex-argument 2))))
|
(pattern (car-safe (evil-delimited-arguments evil-ex-argument 2))))
|
||||||
(if pattern
|
(if pattern
|
||||||
(format "%s matches" (count-matches pattern (car range) (cdr range)) evil-ex-argument)
|
(format "%s matches"
|
||||||
|
(count-matches pattern (car range) (cdr range))
|
||||||
|
evil-ex-argument)
|
||||||
" ... "))
|
" ... "))
|
||||||
:face (if active 'mode-line-count-face 'mode-line-inactive)
|
:face (if active 'mode-line-count-face 'mode-line-inactive)
|
||||||
:skip-alternate t
|
:skip-alternate t
|
||||||
:when (and (evil-ex-p) (evil-ex-hl-active-p 'evil-ex-substitute)))
|
:when (and (evil-ex-p) (evil-ex-hl-active-p 'evil-ex-substitute)))
|
||||||
|
|
||||||
(spaceline-define-segment narf-major-mode
|
(spaceline-define-segment narf-major-mode
|
||||||
(concat "[" mode-name "]")
|
(powerline-raw mode-name)
|
||||||
|
:tight-right t
|
||||||
:skip-alternate t)
|
:skip-alternate t)
|
||||||
|
|
||||||
;; Initialize modeline
|
;; Initialize modeline
|
||||||
|
@ -377,7 +390,7 @@ iedit."
|
||||||
narf-buffer-encoding-abbrev
|
narf-buffer-encoding-abbrev
|
||||||
(narf-major-mode
|
(narf-major-mode
|
||||||
;; (minor-modes :separator " " :tight t)
|
;; (minor-modes :separator " " :tight t)
|
||||||
process :when active)
|
(process :tight t))
|
||||||
(global :when active)
|
(global :when active)
|
||||||
("%l·%c" narf-buffer-position)
|
("%l·%c" narf-buffer-position)
|
||||||
narf-hud
|
narf-hud
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue