Commit Graph

568 Commits

Author SHA1 Message Date
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
ed4dac6f82 glog: Make changing previews persistent
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
2024-11-01 01:30:43 +01:00
1ffd31d585 zsh:keys: Use (A) flag instead of hack to split LBUFFER
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
2024-10-30 16:19:58 +01:00
c7aae00e65 glog: Use core.pager also for Enter action 2024-10-30 15:53:28 +01:00
19fc37299a git:https-and-ssh: Make POSIX-shell compliant
Don't know why this had two shebangs and how I never noticed.
Apparently I only launched the script through the autoloaded
function in zsh.
2024-10-30 10:52:01 +01:00
4d32370ba2 glog: Use git's core.pager
This way diff-so-fancy can easily be replaced/customized.
2024-10-30 10:52:00 +01:00
0cf0bdf82a zprofile: Clear LESS before setting
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.
2024-10-30 10:52:00 +01:00
686a69fedf zprofile: Add Go and Perl related dirs to PATH 2024-10-22 19:15:59 +02:00
92077b75bc zprofile: Set TERMINAL=st
This is used by xdg-open and similar.
2024-10-22 19:15:06 +02:00
4ec1e81873 feh: Use theme configuration file instead of alias 2024-10-22 19:01:45 +02:00
e85f13def7 zsh:alias:feh: Add --start-at flag
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.
2024-10-22 18:46:14 +02:00
e7b287940f zprofile:compat: Use a subshell for fzf_keys
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.
2024-09-27 11:10:27 +02:00
778a3233f5 zprofile: Unset fzf_keys after use 2024-09-27 11:10:26 +02:00
942da616af zprofile: Rename fzf_opts -> fzf_keys 2024-09-27 11:10:26 +02:00
b5bfb81931 fzf: Keep the current line selected when clearing 2024-09-21 01:26:27 +02:00
3c4f483a2c fzf: Add --highlight-line to DEFAULT_OPTS
Similar to vim's 'cursorline'
2024-09-21 01:16:00 +02:00
442a1c1bdc zsh:keys: Make ^E work in vicmd too 2024-09-21 01:06:32 +02:00
35422b6fc4 fzf: Use bfs for ALT_C_COMMAND if available 2024-09-21 01:04:44 +02:00
5552af5076 fzf: Suppress errors in FZF_DEFAULT_COMMAND 2024-09-21 01:02:08 +02:00
0b9d5a4815 zprofile: Add npm/bin to PATH 2024-09-21 01:01:18 +02:00
04fb10687f zprofile: Set XDG_STATE_HOME 2024-09-21 01:01:04 +02:00
9d756c2748 zsh:alias: Add duration that formats seconds 2024-09-20 16:29:51 +02:00
ae626e9e90 zsh:alias: Change gr alias to git reset
I had multiple occasions where I thought that `gr` would resolve to git
reset. I should switch to using `gri` for a rebase.
2024-07-25 11:52:18 +02:00