I dislike having the raw escape byte in these scripts. Unfortunately
`sed` does not support interpreting it via an escape sequence, so use
printf for that. To remain POSIX compatible use `\033` and not `\e` or
`\x1b` since I couldn't find these in the printf(1p) manpage.
Unfortunately this brings a second layer of escaping.
With the last commit 9c1e3f4679 (git:zsh-autoload: Use relative
scripts/ folder, 2025-09-12), `zsh-autoload.sh` could execute any type
of external script. Rename it to a more generic name.
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.
I don't feel as if I'm actively benefiting from match_prev_cmd and it
definitely makes my prompt slower. (One could probably make it faster by
pre-calculating the history events matching the (previously) executed
command in a preexec zsh-hook and then comparing each successor to the
currently typed command instead of repeating all the work every time
BUFFER changes)
With this change my fork is not needed anymore, so switch back to
zsh-users' repo and update it while at it.
This effectively reverts 77b2d63341 ("zsh:autosuggestions: Use own
fork for now").
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).
> Lightning fast left-right movement in Vim.
>
> An always-on highlight for a unique character in every word on a line
> to help you use `f`, `F` and family.
Link: https://github.com/unblevable/quick-scope
> This plugin is inspired by the Narrowing feature of Emacs and means to
> focus on a selected region while making the rest inaccessible. You
> simply select the region, call :NR and the selected part will open in
> a new split window while the rest of the buffer will be protected.
> Once you are finished, simply write the narrowed window (:w) and all
> the changes will be moved back to the original buffer.
I want this to be able to diff two portions of a file without the need
of creating temporary files. (And the ability to automatically bring
back changes sounds nice too.)
Link: https://github.com/chrisbra/NrrwRgn
With commit dd36a4561b0b ("use XDG_DATA_HOME for resurrect-dir path")
the default location of resurrect-dir changed to
$XDG_DATA_HOME/tmux/resurrect as long as $HOME/.tmux does not exist.
This makes manually hard-coding resurrect-dir obsolete.
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.