Previously when calling `glog -- file` with a file that was renamed
sometime in the history, the preview would just be empty for all commits
before the rename, since it's path didn't exist.
Fix this by checking for empty output and falling back to the full patch
in that case.
This also heavily refactors the code around `$fzf_preview` to make it
more readable.
TODO: It would be nice if git-show would fail in this case instead of
just printing nothing and returning zero
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.