Doom modeline and nyan scrollbar; broken Man extensions, colors

This commit is contained in:
MitchMarq42 2022-07-25 06:47:18 -08:00
parent 03e51fd5f9
commit 758506cdbc
3 changed files with 87 additions and 49 deletions

View File

@ -1,4 +1,6 @@
;; man-plus.el ;;; man-plus.el --- Fix the ugly emacs manpages
;;; Commentary:
;; Loosely based on neovim's `man.vim' functionality. ;; Loosely based on neovim's `man.vim' functionality.
;; ;;
;; Feature goals: ;; Feature goals:
@ -6,22 +8,59 @@
;; - Lots of different colors for headings, options, ;; - Lots of different colors for headings, options,
;; sh snippets, etc ;; sh snippets, etc
(setq man-plus-highlights ;;; Code:
'(
("^[A-Z]\([1-9]\)\s*.*$" . 'transient-heading) (defvar man-plus-highlights
("^[a-z]\([1-9]\)\s*.*$" . 'transient-heading) (let* (
("^\s*[A-Z]*$" . 'font-lock-keyword-face) (manReference "[^()[:space:]]\\+(\\%([0-9][a-z]*\\|[nlpox]\\))")
(".*\([1-9]\)" . 'font-lock-string-face) (manSectionHeading "^\\S.*$")
("^\s*-[a-z]*" . 'font-lock-string-face) (manHeader "^\\%1l.*$")
) (manSubHeading "^ \\{3\\}\\S.*$")
) (manOptionDesc "^\\s\\+\\%(+\\|-\\)\\S\\+"))
`(
(,manReference . 'link)
(,manSectionHeading . 'outline-1)
(,manHeader . 'org-document-title)
(,manSubHeading . 'font-lock-function-name-face)
(,manOptionDesc . 'font-lock-constant-face)
)))
(defface manHeader
'((t (:inherit org-document-title)))
"Top-level heading for Man pages..."
:group 'man)
(defface manSectionHeading
'((t (:inherit outline-1)))
"Man section titles..."
:group 'man)
(defface manOptionDesc
'((t (:inherit font-lock-constant-face)))
"Man option descriptions..."
:group 'man)
(defface manReference
'((t (:inherit link)))
"Man references to other pages..."
:group 'man)
(defface manSubHeading
'((t (:inherit font-lock-function-name-face)))
"Manual sub headings..."
:group 'man)
(defun man-plus-setall () (defun man-plus-setall ()
"Do all of the things that Man wants. To be "Do all of the things that Man wants. To be run as `Man-mode-hook'."
run as `Man-mode-hook'." (interactive)
(setq font-lock-defaults '(man-plus-highlights))) (setq font-lock-defaults '((man-plus-highlights))))
(setq Man-mode-hook (add-hook 'man-common-hook #'man-plus-setall)
'man-plus-setall) (add-hook 'man-common-hook #'turn-off-line-numbers)
(define-derived-mode man-plus-mode man-common "Man Plus"
"Custom child mode for man mode, structured like the `nvim' builtin plugin."
(buffer-disable-undo)
(auto-fill-mode -1)
(man-plus-setall)
(turn-off-line-numbers))
(provide 'man-plus) (provide 'man-plus)
;;; man-plus.el ends here
; LocalWords: nlpox

View File

@ -12,8 +12,7 @@
) )
(use-package eldoc (use-package eldoc
:straight (:type built-in) :straight (:type built-in)
:custom :custom (eldoc-echo-area-use-multiline-p nil)
(eldoc-echo-area-use-multiline-p nil)
:defer 1 :defer 1
:diminish) :diminish)
(use-package tramp (use-package tramp
@ -41,8 +40,7 @@
(use-package ibuffer (use-package ibuffer
:straight (:type built-in) :straight (:type built-in)
:commands ibuffer :commands ibuffer
:custom :custom (ibuffer-use-other-window t))
(ibuffer-use-other-window t))
(use-package image-mode (use-package image-mode
:straight (:type built-in) :straight (:type built-in)
:config :config
@ -138,7 +136,9 @@ be built with `xwidget' support."
'((window-width . 0.15) '((window-width . 0.15)
(slot . -1) (slot . -1)
(side . left))) (side . left)))
:hook (dirvish-mode . turn-off-line-numbers) :hook
(dirvish-mode . turn-off-line-numbers)
(dirvish-mode . yascroll-bar-mode)
:general :general
(general-define-key (general-define-key
:states 'normal :states 'normal
@ -357,6 +357,11 @@ targets."
:config :config
;; (load-theme 'airline-kolor t) ;; (load-theme 'airline-kolor t)
(load-theme 'airline-ravenpower t)) (load-theme 'airline-ravenpower t))
(use-package doom-modeline
:init (doom-modeline-mode))
(use-package nyan-mode
:init (nyan-mode))
;; Custom Theme. ;; Custom Theme.
;; Not to be confused with a color theme, or a color scheme, or a custom scheme. ;; Not to be confused with a color theme, or a color scheme, or a custom scheme.
@ -370,16 +375,16 @@ targets."
(menu-bar-mode -1) (menu-bar-mode -1)
(load-theme 'mitch t)) (load-theme 'mitch t))
(use-package yascroll ;; (use-package yascroll
:diminish ;; :diminish
:defer 1 ;; :defer 1
;; :if (not (display-graphic-p)) ;; ;; :if (not (display-graphic-p))
:custom (yascroll:delay-to-hide nil) ;; :custom (yascroll:delay-to-hide nil)
:custom-face ;; :custom-face
(yascroll:thumb-text-area ((t (:background "ForestGreen")))) ;; (yascroll:thumb-text-area ((t (:background "ForestGreen"))))
(yascroll:thumb-fringe ;; (yascroll:thumb-fringe
((t (:background "ForestGreen" :foreground "ForestGreen")))) ;; ((t (:background "ForestGreen" :foreground "ForestGreen"))))
:config (global-yascroll-bar-mode 1)) ;; :config (global-yascroll-bar-mode 1))
;; parentheses settingses ;; parentheses settingses
(use-package paredit (use-package paredit

View File

@ -68,7 +68,7 @@
) )
;; Specify the color palette for each of the classes above. ;; Specify the color palette for each of the classes above.
(mitch-black "black" ) (mitch-black "black" 'nil)
(mitch-red "red" ) (mitch-red "red" )
(mitch-green "ForestGreen") (mitch-green "ForestGreen")
(mitch-yellow "gold1" "white") (mitch-yellow "gold1" "white")
@ -83,9 +83,9 @@
(mitch-light-yellow "PaleGoldenrod") (mitch-light-yellow "PaleGoldenrod")
(mitch-light-blue "RoyalBlue") (mitch-light-blue "RoyalBlue")
(mitch-light-magenta "DarkMagenta") (mitch-light-magenta "DarkMagenta")
(mitch-light-cyan "turquoise3") (mitch-light-cyan "turquoise3" "lightseagreen")
(mitch-light-white "grey69") (mitch-light-white "grey69")
(mitch-visual-bg "DarkBlue") (mitch-visual-bg "DarkBlue" "midnightblue")
(mitch-dark-gray "grey7") (mitch-dark-gray "grey7")
(mitch-dark-yellow "DarkGoldenrod1") (mitch-dark-yellow "DarkGoldenrod1")
(mitch-dark-red "DarkRed") (mitch-dark-red "DarkRed")
@ -96,29 +96,30 @@
;; specifications for Emacs faces. ;; specifications for Emacs faces.
( (
;; (default (:background mitch-black :foreground mitch-light-yellow)) ;; (default (:background mitch-black :foreground mitch-light-yellow))
;; (fixed-pitch (:inherit 'default)) ;; (default (:background mitch-black :foreground mitch-white))
(default (:background mitch-black :foreground mitch-white)) (default (:slant 'normal))
(cursor (:inherit 'default)) (cursor (:inverse-video t))
(highlight (:background mitch-visual-bg)) (highlight (:background mitch-visual-bg))
(region (:inherit 'highlight)) (region (:inherit 'highlight))
(link (:foreground mitch-light-blue :underline 't)) (link (:foreground mitch-light-blue :underline 't))
(link-visited (:foreground mitch-mid-violet :underline 't)) (link-visited (:foreground mitch-mid-violet :underline 't))
(whitespace-line (:background mitch-dark-red)) (whitespace-line (:background mitch-dark-red))
(line-number (:inherit 'font-lock-comment-delimiter-face)) (line-number (:background 'nil :inherit 'font-lock-comment-delimiter-face))
(line-number-current-line (:inherit 'line-number :foreground mitch-yellow :weight 'bold)) (line-number-current-line (:inherit 'line-number :foreground mitch-yellow :weight 'bold))
(linum (:inherit 'line-number)) (linum (:inherit 'line-number))
(linum-relative-current-face (:inherit 'line-number-current-line)) (linum-relative-current-face (:inherit 'line-number-current-line))
(ivy-current-match (:inherit 'highlight :extend t)) (ivy-current-match (:inherit 'highlight :extend t))
(ivy-separator (:inherit 'marginalia-documentation)) (ivy-separator (:inherit 'marginalia-documentation))
(show-paren-match (:background mitch-light-cyan))
;; font-lock faces. The defaults that are important to get right. ;; font-lock faces. The defaults that are important to get right.
(font-lock-comment-face (:foreground mitch-green :slant 'oblique)) (font-lock-comment-face (:foreground mitch-green :slant 'oblique))
(font-lock-comment-delimiter-face (:foreground mitch-light-black)) (font-lock-comment-delimiter-face (:foreground mitch-light-black))
(font-lock-constant-face (:foreground mitch-light-white :weight 'normal)) (font-lock-constant-face (:foreground mitch-light-white :weight 'normal))
(font-lock-string-face (:foreground mitch-light-blue :slant 'italic)) (font-lock-string-face (:foreground mitch-light-blue :slant 'italic))
(font-lock-builtin-face (:foreground mitch-light-white :weight 'bold)) (font-lock-builtin-face (:foreground mitch-light-white :weight 'bold))
(font-lock-keyword-face (:foreground mitch-red :weight 'bold)) (font-lock-keyword-face (:foreground mitch-yellow :weight 'normal))
(font-lock-type-face (:foreground mitch-light-red :weight 'bold)) (font-lock-type-face (:foreground mitch-light-red :weight 'bold))
(font-lock-function-name-face (:foreground mitch-red :weight 'normal)) (font-lock-function-name-face (:foreground mitch-red :weight 'bold))
(font-lock-variable-name-face (:foreground mitch-light-cyan :weight 'normal)) (font-lock-variable-name-face (:foreground mitch-light-cyan :weight 'normal))
(font-lock-negation-char-face (:foreground mitch-visual-bg :weight 'bold)) (font-lock-negation-char-face (:foreground mitch-visual-bg :weight 'bold))
;; other things ;; other things
@ -136,16 +137,7 @@
(completions-highlight (:background mitch-mid-violet)) (completions-highlight (:background mitch-mid-violet))
(corfu-default (:background mitch-mid-gray)) (corfu-default (:background mitch-mid-gray))
(corfu-current (:inherit 'completions-highlight)) (corfu-current (:inherit 'completions-highlight))
;; vterm colors ;; ansi colors
;; (vterm-color-red (:foreground mitch-red :background mitch-light-red))
;; (vterm-color-blue (:foreground mitch-blue :background mitch-light-blue))
;; (vterm-color-cyan (:foreground mitch-cyan :background mitch-light-cyan))
;; (vterm-color-black (:foreground mitch-black :background mitch-light-black))
;; (vterm-color-green (:foreground mitch-green :background mitch-light-green))
;; (vterm-color-white (:foreground mitch-white :background mitch-light-white))
;; (vterm-color-yellow (:foreground mitch-yellow :background mitch-light-yellow))
;; (vterm-color-magenta (:foreground mitch-magenta :background mitch-light-magenta))
;; ansi-term colors
(ansi-color-black (:foreground mitch-black :background mitch-light-black)) (ansi-color-black (:foreground mitch-black :background mitch-light-black))
(ansi-color-red (:foreground mitch-red :background mitch-light-red)) (ansi-color-red (:foreground mitch-red :background mitch-light-red))
(ansi-color-green (:foreground mitch-green :background mitch-light-green)) (ansi-color-green (:foreground mitch-green :background mitch-light-green))
@ -162,6 +154,8 @@
(ansi-color-bright-magenta (:background mitch-magenta :foreground mitch-light-magenta)) (ansi-color-bright-magenta (:background mitch-magenta :foreground mitch-light-magenta))
(ansi-color-bright-cyan (:background mitch-cyan :foreground mitch-light-cyan)) (ansi-color-bright-cyan (:background mitch-cyan :foreground mitch-light-cyan))
(ansi-color-bright-white (:background mitch-white :foreground mitch-light-white)) (ansi-color-bright-white (:background mitch-white :foreground mitch-light-white))
;; man page colors
;; (Man-overstrike (:inherit 'outline-1))
) )
) )