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.
;;
;; Feature goals:
@ -6,22 +8,59 @@
;; - Lots of different colors for headings, options,
;; sh snippets, etc
(setq man-plus-highlights
'(
("^[A-Z]\([1-9]\)\s*.*$" . 'transient-heading)
("^[a-z]\([1-9]\)\s*.*$" . 'transient-heading)
("^\s*[A-Z]*$" . 'font-lock-keyword-face)
(".*\([1-9]\)" . 'font-lock-string-face)
("^\s*-[a-z]*" . 'font-lock-string-face)
)
)
;;; Code:
(defvar man-plus-highlights
(let* (
(manReference "[^()[:space:]]\\+(\\%([0-9][a-z]*\\|[nlpox]\\))")
(manSectionHeading "^\\S.*$")
(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 ()
"Do all of the things that Man wants. To be
run as `Man-mode-hook'."
(setq font-lock-defaults '(man-plus-highlights)))
"Do all of the things that Man wants. To be run as `Man-mode-hook'."
(interactive)
(setq font-lock-defaults '((man-plus-highlights))))
(setq Man-mode-hook
'man-plus-setall)
(add-hook 'man-common-hook #'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)
;;; man-plus.el ends here
; LocalWords: nlpox

View File

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

View File

@ -68,7 +68,7 @@
)
;; Specify the color palette for each of the classes above.
(mitch-black "black" )
(mitch-black "black" 'nil)
(mitch-red "red" )
(mitch-green "ForestGreen")
(mitch-yellow "gold1" "white")
@ -83,9 +83,9 @@
(mitch-light-yellow "PaleGoldenrod")
(mitch-light-blue "RoyalBlue")
(mitch-light-magenta "DarkMagenta")
(mitch-light-cyan "turquoise3")
(mitch-light-cyan "turquoise3" "lightseagreen")
(mitch-light-white "grey69")
(mitch-visual-bg "DarkBlue")
(mitch-visual-bg "DarkBlue" "midnightblue")
(mitch-dark-gray "grey7")
(mitch-dark-yellow "DarkGoldenrod1")
(mitch-dark-red "DarkRed")
@ -96,29 +96,30 @@
;; specifications for Emacs faces.
(
;; (default (:background mitch-black :foreground mitch-light-yellow))
;; (fixed-pitch (:inherit 'default))
(default (:background mitch-black :foreground mitch-white))
(cursor (:inherit 'default))
;; (default (:background mitch-black :foreground mitch-white))
(default (:slant 'normal))
(cursor (:inverse-video t))
(highlight (:background mitch-visual-bg))
(region (:inherit 'highlight))
(link (:foreground mitch-light-blue :underline 't))
(link-visited (:foreground mitch-mid-violet :underline 't))
(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))
(linum (:inherit 'line-number))
(linum-relative-current-face (:inherit 'line-number-current-line))
(ivy-current-match (:inherit 'highlight :extend t))
(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-comment-face (:foreground mitch-green :slant 'oblique))
(font-lock-comment-delimiter-face (:foreground mitch-light-black))
(font-lock-constant-face (:foreground mitch-light-white :weight 'normal))
(font-lock-string-face (:foreground mitch-light-blue :slant 'italic))
(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-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-negation-char-face (:foreground mitch-visual-bg :weight 'bold))
;; other things
@ -136,16 +137,7 @@
(completions-highlight (:background mitch-mid-violet))
(corfu-default (:background mitch-mid-gray))
(corfu-current (:inherit 'completions-highlight))
;; vterm 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 colors
(ansi-color-black (:foreground mitch-black :background mitch-light-black))
(ansi-color-red (:foreground mitch-red :background mitch-light-red))
(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-cyan (:background mitch-cyan :foreground mitch-light-cyan))
(ansi-color-bright-white (:background mitch-white :foreground mitch-light-white))
;; man page colors
;; (Man-overstrike (:inherit 'outline-1))
)
)