Commit Graph

590 Commits

Author SHA1 Message Date
f2adfbf27d zsh:conf: Set local extendedglob instead of (*)
The * parameter expansion flag was only introduced in zsh-5.9. I
currently use a system that still uses 5.8.1 and thus throws:

    conf:29: error in flags
2025-05-28 13:28:48 +02:00
1f80b616c2 *: Fix some old uses of st as terminal
I replaced st with kitty in 0139294831 ("Use kitty instead of st as
terminal").
2025-05-27 18:25:03 +02:00
0c17ae8280 *: Use xargs instead of while read one-line loops 2025-05-27 17:00:35 +02:00
9836b51e16 zsh:glog: Use execute-silent when copying the hash
This way the screen does not flash.
2025-05-23 18:19:03 +02:00
e3689fe68b zsh:glog: Fix some non-local variables 2025-05-23 18:18:35 +02:00
00d28845a3 zsh:glog: Fix preview with files that were renamed
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
2025-05-23 18:09:02 +02:00
339ef90db0 zsh:glog: Rename $out to $hash 2025-05-23 16:44:24 +02:00
e232c8f37b zsh:glog: Use single quotes for file arguments
Since they get interpreted by a shell again, weird file names (e.g.
including dollar signs) would not be passed literally in double quotes.
2025-05-23 16:01:19 +02:00
9a91b464a8 zsh:alias: Add HEAD to gla
`gla` is meant to be `glog --all` without stashes. Add the missing
`HEAD` to be accurate, as it is needed when in detached HEAD.
2025-05-23 15:13:24 +02:00
b5eb5203aa less: Add --ignore-case to LESS 2025-05-22 01:13:40 +02:00
68e1af0328 zsh:conf: Fix HOME fallback
Actually use `_get_config_dir`'s exit code instead of `local`'s (i.e.
always™ zero). This was broken since always.
2025-05-14 18:17:18 +02:00
4914a94ee9 zsh:conf: Stop opening ~/.config as a fallback
This has been a bug for far too long. The entries `config`, `conf` and
`config.ini` of `CONF_PATTERNS` only make sense when looking outside of
`HOME`.
2025-05-14 18:15:28 +02:00
6d5245a56e zsh:conf: Remove trailing slashes before processing
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.
2025-05-14 18:08:19 +02:00
0e4cf4f947 zsh:diffcmds: Add completion function
Completes as the first argument command names and uses then their
completion function to complete the rest.

TODO: <COMMENT>
2025-05-11 16:26:01 +02:00
b2127ae3eb zsh:_conf: Set NULL_GLOB 2025-04-29 11:35:41 +02:00
aafb9a5a3a zsh:_conf: Fix some directory stack empty errors
Fix two cases where `popd` could try to pop from an empty stack.
2025-04-29 11:34:08 +02:00
b722b9aaec zsh:funcs: Fix non-empty dir filter in bfs/find wrapper
The previous filter would filter out every non-regular file (e.g.
symbolic links).
2025-03-28 16:23:05 +01:00
0cb18dedef zsh:keys:cmd-on-enter: Switch until conditions
The requirement does not need to be executed if the idx wrapped around
already.
2025-03-26 00:51:19 +01:00
a9bd4585aa zsh:keys:cmd-on-enter: Take gs out of rotation
It's a bit annoying, ll is sufficient.
2025-03-26 00:50:25 +01:00
1d2e24cf4d zsh:autoload: Make $d local 2025-03-25 11:07:13 +01:00
2363545489 zsh:autoload: Allow nested directories
As well as wrapper in subdirectories.
2025-03-25 11:07:12 +01:00
cd54c3dfed zsh:autoload: Load wrapper only if command exists 2025-03-25 11:07:12 +01:00
e956b8955e zsh: Remove chpwd-readme hook
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.
2025-03-13 14:32:02 +01:00
90b64a8603 zsh:keys: Remove duplicate cd-up definition
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).
2025-02-19 15:18:05 +01:00
d961daf384 zsh:keys: Change one dir up on ^U 2025-02-19 14:01:24 +01:00
a053efa93e zsh:keys: Mention AUTO_PUSHD for cd-{back,for}ward 2025-02-19 14:01:24 +01:00
d57ee922c9 zsh:funcs: Add find() wrapper analog to bfs()
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
2025-02-05 16:53:14 +01:00
ed2b9e760c zsh:bfs(): Make sure that std{out,err} are ttys
When piping its output, I want the normal behaviour.

Also swap the if and else branches for better readability.
2025-02-05 16:53:14 +01:00
f60d25e47c zsh:bfs(): Don't print non-empty dirs by default
I sometimes use find (nowadays bfs) to get an overview of a directory.
In that case I want the output to be as short as possible.
2025-02-05 16:53:13 +01:00
767e5f3019 zsh:rmdir(): Don't change PWD when removing fails 2025-02-05 16:53:13 +01:00
202a0c1437 zsh:alias: Remove mbsync XDG config alias
mbysnc looks for $XDG_CONFIG_HOME/isyncrc
2025-01-30 11:46:11 +01:00
c8c9d887f5 git:checkout-worktree: Echo non-zero exit code 2025-01-29 14:27:11 +01:00
0c0231a2ef git:ssync: Add --new flag
I sometimes do not want to change the working tree of submodules I
changed locally.
2025-01-28 17:25:46 +01:00
2842bba50c vim:ftplug:man: Move scrolling settings from zprofile 2025-01-25 03:02:07 +01:00
1783ee681a glog: More sticky header improvements 2025-01-22 14:56:08 +01:00
e4cab6d581 git:https-and-ssh: Print new remotes when done 2025-01-21 18:22:19 +01:00
c6cdc6ec78 git:https-and-ssh: Swap the if blocks
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 ¯\_(ツ)_/¯
2025-01-21 18:08:18 +01:00
149643a31f git:https-and-ssh: Fix ssh -> https
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.
2025-01-21 18:01:51 +01:00
aa4af50cde glog: s/full/patch in header to understand the bindings 2025-01-08 11:21:07 +01:00
9271350aab zsh:keys: Fix non-existing mapping of vi-kill-word
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")
2024-11-06 13:56:27 +01:00
e82224684b zsh: Re-enable global rc files
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'
2024-11-06 02:51:31 +01:00
22b774b839 zsh:nameddirs: Unset the right variable 2024-11-05 22:18:09 +01:00
724430979c zsh:nameddirs: Only set ws/ss when they exist 2024-11-05 22:17:40 +01:00
7bd42b2e2b zprofile: Add CUDA related paths
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?
2024-11-05 22:14:52 +01:00
c674235adf fzf: Faster preview scrolling by mouse wheel
Don't know yet if want this for normal scrolling too.
2024-11-03 17:26:57 +01:00
d82ad9e8b9 glog: Color the key mappings overview
TODO: Use variables for colors and make customizable
2024-11-01 02:56:15 +01:00
7709ece0f8 glog: Add --highlight-line 2024-11-01 02:42:24 +01:00
9c099416a9 glog: Explicitly set my general fzf bindings
`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.
2024-11-01 02:36:15 +01:00
9802309f12 glog: Display key bindings in sticky header 2024-11-01 02:23:34 +01:00
8be1c63c18 glog: Fix coloring when scrolling
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.
2024-11-01 01:55:03 +01:00