यदि आप चाहते हैं कि इन रंगों को केवल मैन पेज देखने के दौरान ही जोड़ा जाए, न कि आपके द्वारा देखे जाने वाले सभी चीज़ों के लिए less, तो आपको इन वेरिएबल्स को एक आवरण फ़ंक्शन में सेट करना चाहिए manबजाय इसे अपने में डालने के config.fish।
पूरी प्रक्रिया में एक नई फ़ाइल बनाने के लिए है ~/.config/fish/functions/man.fish, और इसके अंदर एक फ़ंक्शन को परिभाषित manकरता है जो आवश्यक पर्यावरण चर सेट करता है, फिर मूल manका उपयोग करके कॉल करता है command, तर्क का उपयोग करके गुजरता है $argv।
यह आवरण समारोह का मेरा संस्करण है:
~/.config/fish/functions/man.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 red)
# end of all formatting:
set -x LESS_TERMCAP_me (set_color normal)
# start of standout (inverted colors):
#set -x LESS_TERMCAP_so (set_color --reverse)
# 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