fish: use LESS_TERMCAP colors for man pages only

This commit is contained in:
Charles Gould 2020-08-17 13:35:25 -04:00
parent d1968327c3
commit d2f0f468e2
2 changed files with 15 additions and 9 deletions

View File

@ -63,15 +63,6 @@ if status --is-interactive
set -g __fish_git_prompt_color_stashstate cyan
set -g __fish_git_prompt_color_untrackedfiles cyan
set -g __fish_git_prompt_color_upstream yellow
# Termcap colors for less and manpages
set -x LESS_TERMCAP_mb (set_color brmagenta)
set -x LESS_TERMCAP_md (set_color brred)
set -x LESS_TERMCAP_me (set_color normal)
set -x LESS_TERMCAP_se (set_color normal)
set -x LESS_TERMCAP_so (set_color -b blue black)
set -x LESS_TERMCAP_ue (set_color normal)
set -x LESS_TERMCAP_us (set_color brgreen)
end
if not set -q __universals_initialized

15
fish/functions/man.fish Normal file
View File

@ -0,0 +1,15 @@
function man --wraps man -d "Colorized man pages"
# descriptions from `man terminfo`
set -lx LESS_TERMCAP_mb (set_color brmagenta) # turn on blinking
set -lx LESS_TERMCAP_md (set_color brred) # turn on bold (extra bright)
set -lx LESS_TERMCAP_us (set_color brgreen) # turn on underline
set -lx LESS_TERMCAP_so (set_color -b blue black) # turn on standout (reverse)
set -lx LESS_TERMCAP_me (set_color normal) # turn off all attributes
set -lx LESS_TERMCAP_ue (set_color normal) # turn off underline
set -lx LESS_TERMCAP_se (set_color normal) # turn off standout (reverse)
# debug setting to print the capability tags being used
#set -lx LESS_TERMCAP_DEBUG on
command man $argv
end