]> git.phdru.name Git - dotfiles.git/commitdiff
Set LESS_TERMCAP_* for light and dark backgrounds
authorOleg Broytman <phd@phdru.name>
Mon, 4 Aug 2014 14:04:41 +0000 (18:04 +0400)
committerOleg Broytman <phd@phdru.name>
Mon, 4 Aug 2014 14:04:41 +0000 (18:04 +0400)
.profile
lib/config/less/dark_bg [new file with mode: 0644]
lib/config/less/light_bg [new file with mode: 0644]

index e2798872d8532e7a0b2e833c5c124f6883da7945..2fd98f0219105c778ceaf0cbe52be446fd3fe5fd 100644 (file)
--- a/.profile
+++ b/.profile
@@ -65,11 +65,13 @@ if [ -t 0 ] ; then
          # mutt, python and vim
          BACKGROUND=DARK
          export BACKGROUND
          # mutt, python and vim
          BACKGROUND=DARK
          export BACKGROUND
+         . "$HOME"/lib/config/less/dark_bg
       ;;
 
       *rxvt*|screen*|*term*|vt100)
          BACKGROUND=LIGHT
          export BACKGROUND
       ;;
 
       *rxvt*|screen*|*term*|vt100)
          BACKGROUND=LIGHT
          export BACKGROUND
+         . "$HOME"/lib/config/less/light_bg
       ;;
    esac
 
       ;;
    esac
 
@@ -185,6 +187,7 @@ if [ -n "$DISPLAY" ]; then
    # mutt, python and vim
    BACKGROUND=LIGHT
    export BACKGROUND
    # mutt, python and vim
    BACKGROUND=LIGHT
    export BACKGROUND
+   . "$HOME"/lib/config/less/light_bg
 
    # BROWSERs
    BROWSER="firefox:seamonkey:chromium:google-chrome:opera:xlinks2:$BROWSER"
 
    # BROWSERs
    BROWSER="firefox:seamonkey:chromium:google-chrome:opera:xlinks2:$BROWSER"
diff --git a/lib/config/less/dark_bg b/lib/config/less/dark_bg
new file mode 100644 (file)
index 0000000..a547352
--- /dev/null
@@ -0,0 +1,14 @@
+# See https://unix.stackexchange.com/q/108699 and man terminfo
+export LESS_TERMCAP_ZN="`tput ssubm`" # Enter subscript mode
+export LESS_TERMCAP_ZO="`tput ssupm`" # Enter superscript mode
+export LESS_TERMCAP_ZV="`tput rsubm`" # End subscript mode
+export LESS_TERMCAP_ZW="`tput rsupm`" # End superscript mode
+export LESS_TERMCAP_mb="`tput bold; tput setaf 2`" # begin blinking - bold green
+export LESS_TERMCAP_md="`tput bold; tput setaf 6`" # begin bold - cyan
+export LESS_TERMCAP_me="`tput sgr0`" # end mode
+export LESS_TERMCAP_mh="`tput dim`" # half-bright mode
+export LESS_TERMCAP_mr="`tput rev`" # reverse video mode
+export LESS_TERMCAP_se="`tput rmso; tput sgr0`" # end standout-mode
+export LESS_TERMCAP_so="`tput bold; tput setaf 7; tput setab 4`" # begin standout-mode (info box) - white on blue
+export LESS_TERMCAP_ue="`tput rmul; tput sgr0`" # end underline
+export LESS_TERMCAP_us="`tput smul; tput bold; tput setaf 7`" #  # begin underline - white
diff --git a/lib/config/less/light_bg b/lib/config/less/light_bg
new file mode 100644 (file)
index 0000000..03df111
--- /dev/null
@@ -0,0 +1,14 @@
+# See https://unix.stackexchange.com/q/108699 and man terminfo
+export LESS_TERMCAP_ZN="`tput ssubm`" # Enter subscript mode
+export LESS_TERMCAP_ZO="`tput ssupm`" # Enter superscript mode
+export LESS_TERMCAP_ZV="`tput rsubm`" # End subscript mode
+export LESS_TERMCAP_ZW="`tput rsupm`" # End superscript mode
+export LESS_TERMCAP_mb="`tput bold; tput setaf 5`" # begin blinking - bold magenta
+export LESS_TERMCAP_md="`tput bold; tput setaf 4`" # begin bold - blue
+export LESS_TERMCAP_me="`tput sgr0`" # end mode
+export LESS_TERMCAP_mh="`tput dim`" # half-bright mode
+export LESS_TERMCAP_mr="`tput rev`" # reverse video mode
+export LESS_TERMCAP_se="`tput rmso; tput sgr0`" # end standout-mode
+export LESS_TERMCAP_so="`tput bold; tput setaf 7; tput setab 4`" # begin standout-mode (info box) - white on blue
+export LESS_TERMCAP_ue="`tput rmul; tput sgr0`" # end underline
+export LESS_TERMCAP_us="`tput smul; tput bold; tput setaf 0`" #  # begin underline - white