From 5854bc87fe329dff62029269a95380ce0ea4a36d Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Thu, 18 Apr 2024 12:34:10 +0200 Subject: [PATCH] Set colors for man to match the background --- .zshrc | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.zshrc b/.zshrc index bb5b990..389d147 100644 --- a/.zshrc +++ b/.zshrc @@ -67,14 +67,26 @@ dup(){ cls() { clear; true } man () { - LESS_TERMCAP_mb=$'\e'"[1;31m" \ - LESS_TERMCAP_md=$'\e'"[1;38;5;88m" \ - LESS_TERMCAP_me=$'\e'"[0m" \ - LESS_TERMCAP_se=$'\e'"[0m" \ - LESS_TERMCAP_so=$'\e'"[1;44;33m" \ - LESS_TERMCAP_ue=$'\e'"[0m" \ - LESS_TERMCAP_us=$'\e'"[1;38;5;22m" \ - command man "$@" + if [[ "$BG" = "dark" ]] + then + LESS_TERMCAP_mb=$'\e'"[1;31m" \ + LESS_TERMCAP_md=$'\e'"[1;32m" \ + LESS_TERMCAP_me=$'\e'"[0m" \ + LESS_TERMCAP_se=$'\e'"[0m" \ + LESS_TERMCAP_so=$'\e'"[1;44;33m" \ + LESS_TERMCAP_ue=$'\e'"[0m" \ + LESS_TERMCAP_us=$'\e'"[36m" \ + command man "$@" + else + LESS_TERMCAP_mb=$'\e'"[1;31m" \ + LESS_TERMCAP_md=$'\e'"[1;38;5;88m" \ + LESS_TERMCAP_me=$'\e'"[0m" \ + LESS_TERMCAP_se=$'\e'"[0m" \ + LESS_TERMCAP_so=$'\e'"[1;44;33m" \ + LESS_TERMCAP_ue=$'\e'"[0m" \ + LESS_TERMCAP_us=$'\e'"[1;38;5;22m" \ + command man "$@" + fi } venv() {