The underscores are an artifact of when this script used to be part of
the bash profile and I didn't want the variables to be exposed too much.
This is no longer relevant.
This makes the common actions previously encoded as bash aliases
independent of the shell (I'm using /bin/sh for the scripts), which will
make a potential switch to zsh easier by having less bash-specific stuff
around.
I was previously using relative paths to $PWD with the implicit
assumption that I would always run `bootstrap` from the dotfiles
root directory. This commit fixes that.
The links are only removed if they are broken and the target was within
the dotfiles bin directory. This makes it easier to deal with removed
and renamed scripts so I don't have to go hunt for them by hand.
Turns out C-b is quite useful for navigation in vim and other programs.
Also, the C-space issue seems to only happen when using Alacritty and
WSL, so I'll just avoid this combination for now.
The substring expansion ${parameter:offset:length} is a bashism and does
not work when /bin/sh points to a shell other than bash, e.g. on Ubuntu.
This commit replaces this expansion with a call to awk, inspired by the
solution at:
https://wiki.ubuntu.com/DashAsBinSh
The solarize script evalss the output of the dircolors(1) but the
LS_COLORS variable gets exported in its environmnent, not the calling
shell where we actually need it so ls(1) and other programs wiill
inherit it.
Therefore, the evaluation of the dircolors(1) output is moved to the
change_bg() function in the shell, so that the LS_COLORS variable is
available to any children of the shell.
The reason why I had missed this is that in most systems I have ls
aliased to exa, which does not care about LS_COLORS and has its own
coloring system. On cygwin, however, exa is not available and I noticed
that the colors were missind; and indeed, on systems with exa the colors
are also missing if I run ls as \ls.
Regardless of the 'ignorecase' option:
==# does case sensitive comparisons
==? does case INsensitive comparisons
All the comparisons that were fixed here should really be case
insensitive (e.g. we want to handle BACKGROUND set to DARK instead of
dark and so on...).
Non-printing characters (like SGR commands to the terminal) need to be
escaped with \[ and \], otherwise readline thinks that these characters
actually take up space and gets confused.
More info: http://mywiki.wooledge.org/BashFAQ/053