This commit addresses a couple of issues:
1. fzf's `key-bindings.zsh` was sourced twice: Once in keys.zsh and once
via the symlink in `external-plugins/`. Fix this by removing the
source in `keys.zsh`.
2. The section about the fzf bindings in keys.zsh was a mess. Reorder
and rewrite some comments to make it nicer.
3. My just added custom `fzf-cd-inplace-widget` does not work like this.
Since `key-bindings.zsh` is sourced (was sourced again) after
`keys.zsh`, my override is overridden itself by the default. I
noticed and fixed this when I originally wrote and tested the
function, but unfortunately I forgot the old `bindkey` commands in
`keys.zsh`, which is why I now forgot about it and committed this
erroneously. To fix this, bind the keys after sourcing
`key-binding.zsh` in the newly added `fzf.key-bindings.config.zsh`.
Additionally, move the widget definition as well to have everything
at one place.
Fixes: 3cf445e739 (zsh:keys: Modify fzf's cd widget to be "in-prompt",
2025-08-06)
Currently, fzf's cd widget executes the cd command via accept-line, so
the command is also visible in the scrollback buffer. In contrast to
this, the cd-{forward,backward,up} suite changes the directory in-place,
without touching BUFFER, with an additional prompt redraw (one could say
"in-prompt"). Since I find this more appealing, overwrite the default
fzf widget with a custom one that has the same behaviour.
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").
Previously when the program name had a trailing slash, `conf` would not
find the right file as it would check for filenames that include a slash
(e.g. `prog/rc`). This was especially annoying, since conf's completion
function inserts a slash automatically when subdirectories exists.
The hook was never added since the `functions` array was misspelled. I
fixed that and left it turned on the last few days and absolutely hate
it. No idea why I ever thought that this could be nice.
I forgot that this was already a thing before d961daf38 ("zsh:keys:
Change one dir up on `^U`") and missed that I only moved the function in
the file instead of creating it (the changes were lying around a bit).
Only difference is that it places a trailing slash behind (empty)
directory names to differentiate them better. bfs does this already.
TODO: Bring these together into one function that checks $0
vi-kill-word does not exist. This change was lying around uncommitted
for ages now.
Fixes: 658797bda2 ("zsh:keys: Use `vi-` variants of navigation binds")
This way better solution using the `(A)` flag was given to me in the
zsh-users mailing list back in 2022 but I forgot to apply it.
See zshexpn(1):
> Convert the substitution into an array expression, even if it
> otherwise would be scalar.
Thanks Mikael!
Link: https://www.zsh.org/mla/users/2022/msg00668.html
I found this in feh's .desktop file and liked the idea:
With `--start-at` feh will load all files from the directory of the
given file and start the filelist at the given one.
This of course breaks easily if I want to pass more flags before the
file argument, but is easily fixed by first specifying the argument to
`--start-at` and continuing with the rest. I also rarely use any flag
besides the one already defined in the alias.