Skip to content

Instantly share code, notes, and snippets.

@leolovenet
Created June 27, 2020 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leolovenet/b28b257feb0d053ea1904fb3439896af to your computer and use it in GitHub Desktop.
Save leolovenet/b28b257feb0d053ea1904fb3439896af to your computer and use it in GitHub Desktop.
#add this function to your $HOME/.config/fish/config.fish
function man
set -x LESS_TERMCAP_mb (printf "\e[01;32m")
set -x LESS_TERMCAP_md (printf "\e[01;32m")
set -x LESS_TERMCAP_me (printf "\e[0m")
set -x LESS_TERMCAP_se (printf "\e[0m")
set -x LESS_TERMCAP_so (printf "\e[01;33m")
set -x LESS_TERMCAP_ue (printf "\e[0m")
set -x LESS_TERMCAP_us (printf "\e[1;4;31m")
# copy from (dir $__fish_data_dir)/fish/functions/man.fish
set -l manpath
if set -q MANPATH
set manpath $MANPATH
else if set -l p (command man -p 2>/dev/null)
set manpath (string replace -r '[^/]+$' '' $p)
else
set manpath ''
end
set -lx MANPATH $manpath
set -l fish_manpath (dirname $__fish_data_dir)/fish/man
if test -d $fish_manpath
set MANPATH $fish_manpath $MANPATH
end
command man $argv
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment