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
My brain assumes that the first block handles the case of the url being
an https one if I read http in the condition. Swap them and negate the
condition for better readability.
This might be a symptom of this condition being to complex, but well -
it's shell scripting ¯\_(ツ)_/¯
Apparently there was an issue with the conversion from ssh to https
which I never noticed? The script would replace the colon of the
`https://` and not the one after the domain:
https///github.com:[...]
I rewrote both cases in a simpler way while fixing the issue.
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")
I am not sure why I ever disabled them, but this goes way back to the
very first commit. Since some packages rely on /etc/profile.d/ to add
their location to PATH I want /etc/zsh/zprofile to source these. On my
current Manjaro machine it contains just this line:
emulate sh -c 'source /etc/profile'
Normally added by /etc/profile.d/cuda.sh and sourced by /etc/prodile.
TODO: Should I source /etc/profile.d/* from one of /etc/zsh/zprofile and
$ZDOTDIR/.zprofile?
`glog` is the most standalone tool out of my dotfiles and I know of at
least one person that uses it that way. Because of this I want to also
explicitly map all other bindings that I have in my zprofile to improve
the experience.
Due to the formatting placeholders sitting on the previous line, the
coloring of the topmost line disappeared when scrolling (as the escape
sequence scrolled away). This had the background that I wanted the code
that sets up the format string to be very readable and if possible very
close to the actual output. And since the colors have all different
lengths I decided to place them on the previous line to have them out of
the way.
Fix this by placing the placeholders on the same output line while still
maintaining a readable format string (code). This is done by joining the
array without placing newlines so that it can now have multiple elements
for one output line and formatting those as wished.
Switch to using the `change-preview()` action that was introduced in
0.29.0 (which was actually not yet released for a year when this feature
was first written). The old `preview()` is a one-off action while
`change-preview()` changes the `--preview` option.
This had the downside that when changing to a different preview and
moving to the next commit one would had to repeat the change. This was
especially annoying when looking through the history of a file that was
renamed. With the commit that renamed the file all previous commits
broke in the `files_only` preview as the path didn't exist yet (A
possible but probably pretty hard TODO to fix).
TODO: glog: Fix files_only preview for renamed files or give prompt to
change the paths
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 just checked on an open shell and noticed that LESS contained what I
meant to put in thrice. Don't know if that has something to do with
tmux, but apparently the zprofile is sourced multiple times? - good to
know.
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.
The `${(*)...}` parameter expansion flag was only introduced in
zsh-5.8.1.2-test, but EXTENDED_GLOB is needed for the `(#m)` globbing
flag. To support older zsh versions too, solve this by using a subshell
in which EXTENDED_GLOB is temporarily enabled.