The motivation for this change comes from several reasons and
frustrations with the previous setup used here.
Firstly, the terminfo variables previously provided did not match those
of the familiar-to-me termcap environment variables, not even remotely
close. The color scheme the termcap variables creates is a largely
yellow-and-white theme, while the terminfo variables created a largely
blue-and-white theme. In addition to being unfamiliar, blue tends to be
somewhat hard to read on my dark theme terminals, so it had to go.
Secondly, in my efforts to update the terminfo variables to match the
colors provided by termcap, I found that bright colors (such as the
bright white used for underlined text) did not display correctly, and it
blatantly ignored any attempts to display colors in their default or
bright color variants. Due to the prevalence of underlined text in
manpages, this meant that I could not achieve the desired color scheme
whatsoever.
Finally, maintaining this convoluted `less` version check is something
I'd rather not do. Because terminfo is not universal and I typically use
stable distributions of linux tending away from the bleeding edge, I can
rely on termcap being available for `less` for some time to come, while
terminfo isn't yet available for Debian stable. Given that, I'd like to
maintain only a single set of color mappings for now. And unless I can
overcome the color issue mentioned in the previous paragraph, I doubt
I'll be interested in maintaining a parity between the two.
n.b. In the process of slimming these definitions down, I did a decent
amount of research to find parity in the text types identified by
terminfo and termcap. The following table details those findings. Note
that termcap variables would be set as environment variables in the
format `LESS_TERMCAP_var` and are set to an ANSI escape sequence for a
Select Graphic Rendition (see
https://stackoverflow.com/a/33206814/540162), and terminfo variables are
passed as arguments to `less` in the format `less -Dv` and are set to a
4-bit or 8-bit color string. (see `man less` on systems with `less
--version` >= 580)
| termcap | terminfo | |
|---------|----------|------------------------------------|
| mb | k | blinking text |
| md | d | bold text |
| me | | end bold/blinking text |
| so | s | reverse video (standout) text |
| se | | end reverse video text |
| us | u | underlined text |
| ue | | end underlined text |
| | B | binary characters |
| | C | control characters |
| | E | errors and info messages |
| | M | mark letters in status column |
| | N | line numbers enabled via -N option |
| | P | prompts |
| rs | R | rscroll character |
| | S | search results |
| | W | highlight enabled via -w option |
Once completed, all necessary symlinks will be created for environment setup. Restart your login for the .bash_profile
to take effect.
Post-setup
There are a few optional files which can be created in the home directory after setup is complete which can aid in
environment setup:
.user.gitconfig: This is primarily used as a way to set up GPG commit signing (as shown in
.user.gitconfig.dist), but can also be used to change the git user name or email on systems
which should use something besides your personal details. (eg. work email on a work machine)
.bash_profile.after and .bashrc.after: These files can be created to run following completion of
.bash_profile and .bashrc, respectively. This is primarily useful for overriding environment variables pointing to
paths of binaries, or adjust aliases which don't work in environments with varying coreutils support for convenience
flags.
Uninstall
Run setup.sh --remove to clear any symlinks created by the setup process.