Commit Graph

595 Commits

Author SHA1 Message Date
5deb69bbd6 git:checkout-worktree: Improve name on recursion
When calling git-checkout-worktree from inside a temporary working tree
(doesn't necessary need to be a recursive call, could be another shell
too) the name would be very long.

Fix this by using the folder name of the main working tree.
2023-04-11 23:24:52 +02:00
072204c10c vim:keys: Discard stderr in FZF_CTRL_T_COMMAND
The prompt gets messed up on error messages from `find` (e.g. permission
errors). Discard them.
2023-04-11 22:49:15 +02:00
a68599d9ae zsh:zprofile: Add $MBSYNCRC
Additionally to the mbsync alias that was already created, add
`$MBSYNCRC` so that mutt-wizards tools use the correct config as well.
2023-03-31 02:30:01 +02:00
4640dec63d zsh:suffix(): Use zshisms to find --'s index 2023-02-27 14:13:54 +01:00
112b195d7b zsh:keys:TODO: Rather insert line on ^R 2023-02-27 14:11:43 +01:00
e8a9f5d828 zsh:alias:TODO: Improve vim/fg wrapper 2023-02-27 14:10:17 +01:00
44e83ee8d6 git:glog:TODO: Better file arguments handling 2023-02-27 14:01:49 +01:00
8e183a37bf zsh:keys: Bind ^U to cd ..
I do not use readline/emacs(?) mapping to clear the line with ^U anyways
as I have my beloved vim bindings.
2023-02-23 14:44:59 +01:00
a85d6c53c4 zsh:keys:go-shcwd: Only exclude exact $PWD
Fix the grep call to only exclude lines that are exactly the PWD instead
of containing it.
2023-02-23 14:44:59 +01:00
cf48efb4cb zsh:keys:go-shcwd: Do not suggest $PWD 2023-02-23 14:44:59 +01:00
86c3c1992a zsh:keys: Bind ^G to fuzzy shcwd 2023-02-23 14:44:59 +01:00
51a2ab77d7 zsh:keys: Extract redraw-prompt from cd-rotate
This makes it possible to use it in other bindings.
2023-02-23 14:32:54 +01:00
10824feb74 git:checkout-worktree: Make errc variable local 2023-02-13 17:18:25 +01:00
28f60004de git:checkout-worktree: Fix unset ret variable 2023-02-13 17:17:49 +01:00
0625fdbd94 git:last-changed: Fix handling of weird filenames
Make sure that `git-log` does not misunderstand the file name.
2023-02-13 17:13:41 +01:00
0a749cd6f5 git:last-changed: Equalize ANSI sanitization regex
Don't know why I used two different patterns.
2023-02-13 17:08:16 +01:00
226f09b046 zsh:mvln(): Create relative symlinks
When using ln's `-a` flag, absolute paths are not necessary.
2023-02-09 17:08:49 +01:00
7739d0a9c3 zsh:mvln(): Refactor to fewer lines and zshisms 2023-02-09 17:08:48 +01:00
69f8bd8631 zsh:mvln(): Make variables local 2023-02-09 17:08:42 +01:00
78a7b0d809 git:glog:TODO: Depend preview function on --stat 2023-02-09 13:22:19 +01:00
8baaaf0e94 git:glog:TODO: Display ... in patch-stat 2023-02-09 13:21:00 +01:00
9449b7fecd git:glog: Respect file arguments when previewing
When file arguments were passes behind `--`, show only these files in
the patch preview. This mimics the behaviour of `git log -up --
<files>`.

The full patch can still be displayed with ctrl-p.
2023-02-09 13:17:32 +01:00
83b79aab10 vim:opts: Set GLOB_COMPLETE 2023-01-27 00:25:01 +01:00
e1b46bddc3 zsh,git: Add completion for git-https-and-ssh
Complete remotes.

Also remove redundant compdef lines. The _git-<command> functions are
used automatically.
2023-01-25 03:19:11 +01:00
47e13d36a6 git:https-and-ssh: Support passing custom remote 2023-01-25 03:06:57 +01:00
5d750e5962 zsh:pdfunite(): Fix execution through missing $0
I don't know what happened there. Apparently I just checked that the
early-abort condition works.
2023-01-23 01:25:39 +01:00
a205a7c5ce zsh:opts: Disable CDABLE_VARS
It annoys me more than it helps me.
2023-01-21 12:40:17 +01:00
e9a82452fd zsh:psofof(): Remove duplicates 2023-01-21 02:00:59 +01:00
884d12d237 zsh:funcs: Add psofof to list pids from lsof 2023-01-21 01:59:23 +01:00
3b3ec03d01 zsh:alias: Add gca for git commit --amend 2023-01-21 01:58:32 +01:00
c8b634b81f git:https-and-ssh: Use shorter variant to get url 2023-01-21 01:57:37 +01:00
f0194794f9 zsh:alias: Add gcl for git commit-last-msg 2023-01-21 01:56:30 +01:00
401fc939ea zsh:alias: Add more possibilities for glog-aliases
It kind of follows a pattern: `a` for `all` (i.e. --branches --remotes)
and `g` for `graph` (but adding another `l` is ok too).
2023-01-20 12:57:40 +01:00
b35ef3603f zsh:alias: Add gla for glog --branches --remotes
Sometimes I want to see other branches but the repository is too big for
`--graph`.

Add `gla` as alias to `glog --branches --remotes` similar to `glll`.

Add `glla` as further alias to `glll` and make the brace expansion more
verbose for better readability.
2023-01-19 03:16:33 +01:00
0d39158b7c zsh:compl: Add TODO for git-completion for-loop 2023-01-17 16:49:38 +01:00
a88ce81b92 zsh:compl: Remove unused git-signoff completion
The shell function git-signoff was replaced with gits builtin
functionality in 09ef4d4d93 ("git: Replace git-signoff with `rebase
--signoff`").

Also adjust the example in the new commment.
2023-01-17 16:48:32 +01:00
5a0c6cdefb git: Fix completion for aliases to shell functions
When only linking the completion function, the completion works for the
shell functions, but not when using a git alias to those functions.

Fix that by defining own completion functions for each that call the
existing/copied ones.
2023-01-17 16:42:34 +01:00
0ae5f17dd0 git:last-changed: Fix truncation of colored lines
`cut` counts bytes instead of printable character, making it truncate
colored lines too early.

Fix this by using awk and adding the length difference between a colored
and uncolored version to the allowed length.

COLUMNS is a shell variable and thus needs exporting for `ENVIRON` to
see it in awk.
2023-01-17 16:33:53 +01:00
4c489c0d68 git:last-changed: Handle non-git-repo gracefully 2023-01-17 01:44:01 +01:00
99c99954e9 git:last-changed: Pass -p and smart --color flag
--color=auto breaks as `ls` is always piped. Test stdout of the whole
script to determine a sensible value for the flag.
2023-01-17 01:41:38 +01:00
9f0ffcb6ca git:last-changed: Support ANSI escape sequences
When passing --color to `ls` and the entry were colored, git would not
return a commit due to the escape sequences.
2023-01-17 01:39:43 +01:00
f317ed81c2 git: Add last-changed to mimic github file browser
List all files and directories but include the latest commits date and
subject, similar to the file browser in web-UIs of services like GitHub.
Also sort the entries by the commits date and time to see the most
recent changed files/folders at the bottom.
2023-01-17 01:38:17 +01:00
a7b975ae71 zsh:keys:cmd-on-enter: Check PREBUFFER as well
When typing a multi-line input (e.g. `echo foo\<CR>`) BUFFER can be
empty, even though the entire input is not.

Fix this by checking if PREBUFFER and BUFFER are empty.
2023-01-17 00:33:19 +01:00
6bfc7bbcbc zsh:funcs: Write a wrapper for pdfunite
Write a wrapper for pdfunite that tries to prevent an overwrite of an
existing file when forgetting to specify the destination-file.
2023-01-11 22:03:19 +01:00
5c1b67ddfc zsh:keys:cmd-on-enter: Don't place cmds in history 2022-12-29 18:09:20 +01:00
8da38e9224 zsh:options: Make globbing sensitive to case
I am not sure why I had this activated.

Case insensitive globbing can still be achieved by using the Globbing
Flag `i`.
2022-12-28 17:05:15 +01:00
6672387bee zsh:funcs:finddup: Use byte size for first filter
Use the byte size as first filter instead of the size in 1KB blocks.

This way the filter is way more accurate and filters out more files
for which the md5sum does not need to be calculated.
2022-12-28 02:02:04 +01:00
6bb26ac2fd zsh:funcs:finddup: Add TODO to use CRC instead md5 2022-12-28 01:56:55 +01:00
b38e01c72a zsh:funcs:finddup: Support filenames with spaces
Previously when filenames contained spaces, the function would break as
`awk {print $2,$1}` would only print a part of the filename.

The field swap was used as a workaround so that `uniq` only compares the
sizes, and `uniq` unfortunately only has a flag to **skip** fields.

Fix this issue by using a short awk script that mimics `uniq` but only
with the first field (i.e. the size).

My awk foo is unfortunately not very good, and that is why the one-liner
prints out the first duplicated line multiple time. The `sort -u` pipe
afterwards gets rid of those.
2022-12-28 01:52:56 +01:00
df39b04cb2 zsh:ls-show-hidden: Take quotes in double brackets 2022-12-27 16:53:25 +01:00