mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-23 19:19:50 +00:00
[Feature] Info mode-line.
This commit is contained in:
parent
e902f41638
commit
7ce5e477f3
2 changed files with 57 additions and 13 deletions
|
@ -39,6 +39,9 @@
|
||||||
;; Externals
|
;; Externals
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
(defvar Info-current-file)
|
||||||
|
(defvar Info-current-node)
|
||||||
|
(defvar Info-mode-line-node-keymap)
|
||||||
(defvar anzu--cached-count)
|
(defvar anzu--cached-count)
|
||||||
(defvar anzu--current-position)
|
(defvar anzu--current-position)
|
||||||
(defvar anzu--overflow-p)
|
(defvar anzu--overflow-p)
|
||||||
|
@ -1517,6 +1520,36 @@ mouse-3: Describe current input method")
|
||||||
'local-map mode-line-input-method-map))
|
'local-map mode-line-input-method-map))
|
||||||
|
|
||||||
|
|
||||||
|
;;
|
||||||
|
;; Info
|
||||||
|
;;
|
||||||
|
|
||||||
|
(doom-modeline-def-segment info
|
||||||
|
"The segment for `Info-mode'."
|
||||||
|
(let ((active (doom-modeline--active)))
|
||||||
|
(concat
|
||||||
|
" ("
|
||||||
|
;; topic
|
||||||
|
(propertize (if (stringp Info-current-file)
|
||||||
|
(replace-regexp-in-string
|
||||||
|
"%" "%%"
|
||||||
|
(file-name-sans-extension
|
||||||
|
(file-name-nondirectory Info-current-file)))
|
||||||
|
(format "*%S*" Info-current-file))
|
||||||
|
'face (if active 'doom-modeline-info 'mode-line-inactive))
|
||||||
|
") "
|
||||||
|
;; node
|
||||||
|
(if Info-current-node
|
||||||
|
(propertize (replace-regexp-in-string
|
||||||
|
"%" "%%" Info-current-node)
|
||||||
|
'face (if active 'doom-modeline-buffer-path 'mode-line-inactive)
|
||||||
|
'help-echo
|
||||||
|
"mouse-1: scroll forward, mouse-3: scroll back"
|
||||||
|
'mouse-face 'mode-line-highlight
|
||||||
|
'local-map Info-mode-line-node-keymap)
|
||||||
|
""))))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; LSP
|
;; LSP
|
||||||
;;
|
;;
|
||||||
|
@ -2065,7 +2098,7 @@ we don't want to remove that so we just return the original."
|
||||||
|
|
||||||
(when (and doom-modeline-icon doom-modeline-major-mode-icon)
|
(when (and doom-modeline-icon doom-modeline-major-mode-icon)
|
||||||
(concat " "
|
(concat " "
|
||||||
(let ((icon (doom-modeline-icon-for-mode 'paradox-menu-mode)))
|
(let ((icon (doom-modeline-icon-for-mode 'paradox-menu-mode :v-adjust -0.15)))
|
||||||
(propertize icon 'face `(:inherit
|
(propertize icon 'face `(:inherit
|
||||||
,(let ((props (get-text-property 0 'face icon)))
|
,(let ((props (get-text-property 0 'face icon)))
|
||||||
(if doom-modeline-major-mode-color-icon
|
(if doom-modeline-major-mode-color-icon
|
||||||
|
|
|
@ -98,6 +98,14 @@
|
||||||
'(bar window-number " " buffer-default-directory)
|
'(bar window-number " " buffer-default-directory)
|
||||||
'(misc-info fancy-battery mu4e github debug " " major-mode process))
|
'(misc-info fancy-battery mu4e github debug " " major-mode process))
|
||||||
|
|
||||||
|
(doom-modeline-def-modeline 'package
|
||||||
|
'(bar window-number package)
|
||||||
|
'(misc-info " " major-mode process))
|
||||||
|
|
||||||
|
(doom-modeline-def-modeline 'info
|
||||||
|
'(bar window-number buffer-info info buffer-position parrot selection-info)
|
||||||
|
'(misc-info buffer-encoding major-mode))
|
||||||
|
|
||||||
(doom-modeline-def-modeline 'media
|
(doom-modeline-def-modeline 'media
|
||||||
'(bar window-number buffer-size buffer-info)
|
'(bar window-number buffer-size buffer-info)
|
||||||
'(misc-info media-info major-mode process vcs))
|
'(misc-info media-info major-mode process vcs))
|
||||||
|
@ -106,10 +114,6 @@
|
||||||
'(bar window-number buffer-size buffer-info pdf-pages)
|
'(bar window-number buffer-size buffer-info pdf-pages)
|
||||||
'(misc-info " " major-mode process vcs))
|
'(misc-info " " major-mode process vcs))
|
||||||
|
|
||||||
(doom-modeline-def-modeline 'package
|
|
||||||
'(bar window-number package)
|
|
||||||
'(misc-info " " major-mode process))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Interfaces
|
;; Interfaces
|
||||||
|
@ -137,26 +141,31 @@ If DEFAULT is non-nil, set the default mode-line for all buffers."
|
||||||
"Set sepcial mode-line."
|
"Set sepcial mode-line."
|
||||||
(doom-modeline-set-modeline 'special))
|
(doom-modeline-set-modeline 'special))
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun doom-modeline-set-media-modeline ()
|
|
||||||
"Set media mode-line."
|
|
||||||
(doom-modeline-set-modeline 'media))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom-modeline-set-project-modeline ()
|
(defun doom-modeline-set-project-modeline ()
|
||||||
"Set project mode-line."
|
"Set project mode-line."
|
||||||
(doom-modeline-set-modeline 'project))
|
(doom-modeline-set-modeline 'project))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom-modeline-set-pdf-modeline ()
|
(defun doom-modeline-set-info-modeline ()
|
||||||
"Set pdf mode-line."
|
"Set Info mode-line."
|
||||||
(doom-modeline-set-modeline 'pdf))
|
(doom-modeline-set-modeline 'info))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom-modeline-set-package-modeline ()
|
(defun doom-modeline-set-package-modeline ()
|
||||||
"Set package mode-line."
|
"Set package mode-line."
|
||||||
(doom-modeline-set-modeline 'package))
|
(doom-modeline-set-modeline 'package))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun doom-modeline-set-media-modeline ()
|
||||||
|
"Set media mode-line."
|
||||||
|
(doom-modeline-set-modeline 'media))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun doom-modeline-set-pdf-modeline ()
|
||||||
|
"Set pdf mode-line."
|
||||||
|
(doom-modeline-set-modeline 'pdf))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Mode
|
;; Mode
|
||||||
|
@ -181,6 +190,7 @@ If DEFAULT is non-nil, set the default mode-line for all buffers."
|
||||||
(with-current-buffer bname
|
(with-current-buffer bname
|
||||||
(doom-modeline-set-main-modeline))))
|
(doom-modeline-set-main-modeline))))
|
||||||
;; Add hooks
|
;; Add hooks
|
||||||
|
(add-hook 'Info-mode-hook #'doom-modeline-set-info-modeline)
|
||||||
(add-hook 'magit-mode-hook #'doom-modeline-set-project-modeline)
|
(add-hook 'magit-mode-hook #'doom-modeline-set-project-modeline)
|
||||||
(add-hook 'dashboard-mode-hook #'doom-modeline-set-project-modeline)
|
(add-hook 'dashboard-mode-hook #'doom-modeline-set-project-modeline)
|
||||||
(add-hook 'image-mode-hook #'doom-modeline-set-media-modeline)
|
(add-hook 'image-mode-hook #'doom-modeline-set-media-modeline)
|
||||||
|
@ -191,6 +201,7 @@ If DEFAULT is non-nil, set the default mode-line for all buffers."
|
||||||
;; Restore mode-line
|
;; Restore mode-line
|
||||||
(setq-default mode-line-format doom-modeline--default-mode-line)
|
(setq-default mode-line-format doom-modeline--default-mode-line)
|
||||||
;; Remove hooks
|
;; Remove hooks
|
||||||
|
(remove-hook 'Info-mode-hook #'doom-modeline-set-info-modeline)
|
||||||
(remove-hook 'magit-mode-hook #'doom-modeline-set-project-modeline)
|
(remove-hook 'magit-mode-hook #'doom-modeline-set-project-modeline)
|
||||||
(remove-hook 'dashboard-mode-hook #'doom-modeline-set-project-modeline)
|
(remove-hook 'dashboard-mode-hook #'doom-modeline-set-project-modeline)
|
||||||
(remove-hook 'image-mode-hook #'doom-modeline-set-media-modeline)
|
(remove-hook 'image-mode-hook #'doom-modeline-set-media-modeline)
|
||||||
|
|
Loading…
Reference in a new issue