dotfiles/fish/functions/man.fish
2021-01-13 05:17:22 -06:00

28 lines
1,012 B
Fish
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env fish
function man --description "wrap the 'man' manual page opener to use color in formatting"
# based on this group of settings and explanation for them:
# http://boredzo.org/blog/archives/2016-08-15/colorized-man-pages-understood-and-customized
# converted to Fish shell syntax thanks to this page:
# http://askubuntu.com/questions/522599/how-to-get-color-man-pages-under-fish-shell/650192
# start of bold:
set -x LESS_TERMCAP_md (set_color --bold blue)
# end of all formatting:
set -x LESS_TERMCAP_me (set_color normal)
# start of standout (inverted colors):
set -x LESS_TERMCAP_so (set_color --bold green)
# end of standout (inverted colors):
set -x LESS_TERMCAP_se (set_color normal)
# (no change I like the default)
# start of underline:
set -x LESS_TERMCAP_us (set_color --underline)
# end of underline:
set -x LESS_TERMCAP_ue (set_color normal)
# (no change I like the default)
command man $argv
end