Skip to content

Commit

Permalink
Merge pull request #2009 from gaelicWizard/plugin-man
Browse files Browse the repository at this point in the history
Plugin/man: Add `R` to `$LESS`
  • Loading branch information
NoahGorny authored Jan 7, 2022
2 parents 5d68fca + dc5c9e1 commit dba610c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions clean_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ plugins/available/java.plugin.bash
plugins/available/jekyll.plugin.bash
plugins/available/jump.plugin.bash
plugins/available/less-pretty-cat.plugin.bash
plugins/available/man.plugin.bash
plugins/available/node.plugin.bash
plugins/available/nodenv.plugin.bash
plugins/available/osx-timemachine.plugin.bash
Expand Down
20 changes: 12 additions & 8 deletions plugins/available/man.plugin.bash
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
cite about-plugin
# shellcheck shell=bash
about-plugin 'colorize man pages for better readability'

export LESS_TERMCAP_mb=$'\e[1;32m'
export LESS_TERMCAP_md=$'\e[1;32m'
export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[01;33m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[1;4;31m'
: "${LESS_TERMCAP_mb:=$'\e[1;32m'}"
: "${LESS_TERMCAP_md:=$'\e[1;32m'}"
: "${LESS_TERMCAP_me:=$'\e[0m'}"
: "${LESS_TERMCAP_se:=$'\e[0m'}"
: "${LESS_TERMCAP_so:=$'\e[01;33m'}"
: "${LESS_TERMCAP_ue:=$'\e[0m'}"
: "${LESS_TERMCAP_us:=$'\e[1;4;31m'}"

: "${LESS:=}"
export "${!LESS_TERMCAP@}"
export LESS="R${LESS#-}"

0 comments on commit dba610c

Please sign in to comment.