Similar to `no-ansi-sgr` but removes all ANSI escape sequence, not just
the SGR ones.
See the previous commit bbf9a1da58 (bin:no-ansi-sgr: Set LC_ALL=C for
`[0-?]` range, 2025-07-30) for an explanation of why LC_ALL has to be
set.
Setting LC_ALL=C makes it possible to use the range `[0-?]` instead of
splitting it into `[0-9:-?]` as done previously. Without LC_ALL, sed
complains with:
sed: -e expression #1, char 21: Invalid range end
The GNU manual explains this partially, although I still don't quite
understand why this range specifically does not work in `en_US.utf8`.
See:
> Within a bracket expression, a *range expression* consists of two
> characters separated by a hyphen. It matches any single character that
> sorts between the two characters, inclusive. In the default C locale,
> the sorting sequence is the native character order; for example,
> `[a-d]` is equivalent to `[abcd]`.
Link: https://www.gnu.org/software/sed/manual/sed.html#Character-Classes-and-Bracket-Expressions
Previously - in the existence of other ANSI escape sequences - the
script deleted text due to the too broad regex. For example in:
foo^[[K bar m
everything behind `foo` was deleted. Thus, only remove SGR sequences by
only matching the spec-allowed bytes.
Since I run kitty with --single-instance, xcwd does not work for it.
Replace it with a short script that retrieves the CWD for the focused
window through the remote-control ls command.
This changes the current behaviour slightly, since now only terminals
are used and not any X window (which I rarely used or needed) and that
the working dir of the shell running in kitty will be used and not of
any deeper children. I'm still unsure if I want the latter back, but
will figure this out in the future.
This is an addendum to 0139294831 ("Use kitty instead of st as
terminal").
In git aliases, shell commands are executed from the top-level directory
of the repo. Because of this, something like `git glog -- file` didn't
work in subdirectories.
Fix this by creating a wrapper script that first changes into
$GIT_PREFIX before executing the script. Since (currently) the only
use-case is to launch the functions in `autoload/git/`, most of the path
could move into the script, making the git config a lot cleaner.
It was moved back in 020b39887e ("gpg,git: Move gpg.loopback into
PATH"), because git had problems with the "dynamic" path of HOME. I like
to have everything at one place though (And I searched for this script
in the wrong place, just now).
This script is meant to be used in the future in an interactive fzf
window bound to a key, so that one can quickly cd into the CWD of
another running shell.
The function `die` was redundantly implemented in various files.
Move the function into .local/bin/helpers.sh and source that where
previously implemented.
Also prepend the program's name to the message and always terminate the
message with a newline. The newline was previously needed for a small
but unnecessary hack that prevented the need of the `[ -z "$1" ]` test.
Move all submodules that were under .config/ into .local/share/ (alias
XDG_DATA_HOME). I got convinced that they feel out of place in .config/.
Instead of updating the paths from which they are sourced (e.g.
`TMUX_PLUGIN_MANAGER_PATH` or `packpath`), keep a symlink in the old
location that points to the new one. This has the benefit that
everything related to one program remains mostly accessible from the
same place instead of spreading everything out.
I am still unsure if I really like the new location as I affiliate user
**data** more with something that has to be backed up as it is
non-recreatable. And moving them out of .config/ had the reasoning that
they are not my config files but rather data from the internet that
could be retrieved when deleting. But using XDG_CACHE_HOME seems
unreasonable as well.
We'll see.
Move the fzf-repo from ./local/bin/ to .local/share/.
Update all relative symlinks' (e.g. fzf) targets.
I am a big supporter of the approach to indent with tabs and align with
spaces. (Read [here][1] f.e.) Thus at some places a simple `s/ {4}/\t/g`
(replace 4 with whatever fits) is not enough and a bit more thought is
needed. Because of that there are still places where I plan to
substitute the whitespace in the future.
This patch contains exclusively whitespace changes. Check for yourself
with `git diff --ignore-all-space`.
[1]: https://dmitryfrank.com/articles/indent_with_tabs_align_with_spaces
Wrap lines at 80 columns where appropriate and I had the energy to think
about how/where to wrap.
There are still lines longer than that, which I plan to wrap in the
future. But that is enough for now.
Update all submodules to the newest commit.
Change submodule names in `.gitmodules` from local path to repo names.
Sort and group `.gitmodules` by program that uses it.
Remove the clone of 'fzf-tab' as my pull request got merged.
Since fzf is not really only a zsh plugin this moves it to .local/bin.
I am not quite sure it will stay there.
The submodule was also updated in this process.
Update all links and references.
Add .local/share directory that contains the man pages. By that dotbot
just globs all of them and symlinks them. This makes it more modular and
a bit more transparent on how an installed system looks like, just by
looking through the repo structure.
Fix bug that `cut` only took the second field when splitting on ';'
instead of everything after the first semicolon and thus not properly
handling commands that contain semicolons.
Add die() and hist-sort().
Use here-string instead of process substitution with input redirection.
Rephrase comment.