Commit Graph

622 Commits

Author SHA1 Message Date
65d99c40e8 git🐮 Keep relative path offset 2025-09-15 13:49:33 +02:00
d28ef61694 git🐮 Rename temporary worktree directory
Shorten the "worktree" and place the random bytes at the end for better
sorting.
2025-09-15 13:23:01 +02:00
d5a95f9ce5 git🐮 Fix name of submodules
Previously git-checkout-worktree would use the name of the superproject
instead of the submodule for the temporary directory.
2025-09-15 13:19:28 +02:00
bb7ef3769d git: Add branch-rename
Small script to rename a branch locally and on a given remote.
2025-09-12 14:35:44 +02:00
0534ec493e zsh:alias: Make sizes an anonymous function
This way one can easily redirect stderr for both commands (not just
`sort`) and specify a path. The path defaults to the current directory,
but listing each entry by globbing.
2025-09-07 21:09:11 +02:00
198069fac7 zsh:alias: Add -a to cp
Preserve all attributes (i.e. timestamps, permissions, etc.). This also
implies `--recursive` which I probably could have added already sooner.
2025-08-30 11:48:45 +02:00
4c12418b62 git:track: Fix unnecessary subshell launch
While at it, modify the formatting of the line above slightly.
2025-08-28 12:24:06 +02:00
5767210dce git:track: List remote refs only on request
List only the local heads by default and require the remote refs to be
passed as arguments. For example:

	git track origin

To make this easier, add support of an `--all` flag to list all remote
refs.
2025-08-28 12:24:02 +02:00
1f6fb2abf7 zsh:glog: Bind Ctrl-s to toggle-sort
When searching for a specific commit in a long history the chronological
sorting can sometimes be annoying. Map ctrl-s to toggle-sort so that the
best result can be at the top.
2025-08-24 20:57:23 +02:00
b47c91bb5f zsh:glog: Use Ctrl-Alt for preview bindings
This makes it more consistent with the preview scroll bindings.
2025-08-24 20:57:17 +02:00
fec954c30c zsh:glog: Move header into variable 2025-08-24 20:57:10 +02:00
a3e83e4844 zsh:alias:lsblk: Display all mountpoints 2025-08-07 13:10:02 +02:00
0af6c9fb24 zsh:keys: Fix override of fzf-cd-widget
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)
2025-08-06 13:30:56 +02:00
3cf445e739 zsh:keys: Modify fzf's cd widget to be "in-prompt"
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.
2025-08-06 12:30:35 +02:00
d9feb1d468 zsh:p10k: Add custom Session.vim prompt segment 2025-07-09 01:27:37 +02:00
bc0de45375 zsh:funcs: Add findup to search parent directories 2025-07-04 13:41:30 +02:00
0e7171bd5f zsh:diffcmds: Make diff_cmd overwritable by caller 2025-06-30 14:11:31 +02:00
db9aad5dcd zsh:diffcmds: Fix wrong variable assignment 2025-06-30 14:11:30 +02:00
4b5dbd161a zsh:autosuggestions: Switch to history strategy
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").
2025-06-24 00:06:33 +02:00
b7af03770e zsh:alias: Add TYPE column to lsblk output 2025-06-23 22:07:02 +02:00
6dcf97e249 zsh:alias: Add bytestr 2025-06-23 22:04:27 +02:00
f3d8ea3de0 less: Move $LESS from .zprofile to lesskey 2025-06-20 15:15:07 +02:00
075dbf2431 zsh:diffcmds: Clarify lseek(2) comment 2025-06-20 14:14:03 +02:00
c27bf72fee zsh:diffcmds: Slight refactor & format adjustments 2025-06-20 12:29:19 +02:00
f636479b70 zsh:diffcmds: Improve usage description 2025-06-20 12:24:17 +02:00
740c0b2fd7 git: Add git-abort & git-continue
I find typing `git {rebase,merge,...} --{continue,abort}` a bit
annoying, since it is a lot of typing. I have added an alias for `rebase
--continue` (grc), but the problem remained for the other commands.

Add a script that continues or aborts the ongoing process by detecting
it automatically.
2025-06-19 14:03:17 +02:00
9ed2f526da zsh:autoload: Fix loading of symlinked functions
Only plain files were autoloaded because of the glob qualifier. Switch
to no-directories so that symlinks (e.g. git-ssh-and-https) are loaded.
2025-06-19 12:49:01 +02:00
e121743d8a zsh:options: Disable CDABLE_VARS
It annoys me too often (I always see the named directories in the
completion menu and had problems with files/folders with the same name).
2025-06-05 11:45:47 +02:00
e451fbdd22 zsh:options: Set C_PRECEDENCES 2025-06-05 11:45:19 +02:00
5212f2a217 zsh:alias: Add calculator with output in hex
I never used the old hex alias.
2025-06-05 11:42:04 +02:00
04ef69c021 zsh:rationalize-dots: Self-insert when replacing 2025-06-02 11:32:27 +02:00
d0e5d92d2c zprofile: Don't set MBSYNCRC
mbsync reads `$XDG_CONFIG_HOME/isyncrc` now by default.
2025-05-30 14:09:32 +02:00
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