Commit Graph

625 Commits

Author SHA1 Message Date
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
3ddfadf360 zsh:ls-show-hidden: Fix listing of broken symlinks
The `-e` and `-d` checks fail if the file is a broken symlink, which
would lead to a 'No such file...' message for each of them.
2022-12-27 16:47:17 +01:00
c4125ddc25 zsh:ls-show-hidden: Fix ./ listing on non-existing
Fix a bug that ls-show-hidden always listed `./` when all other non-flag
arguments were non-existing (in addition to their 'No such file...'
message).
2022-12-27 16:45:06 +01:00
9b0e49b319 zsh:ls-show-hidden: Use short param expansion form
Use the short parameter expansion form where it leads to a better
readability in my eyes (e.g. "${dir:A}" -> "$dir:A" does not, I think.)
2022-12-27 16:39:40 +01:00
b93c4ee377 zsh:glog: Only pipe to fzf if stdout is a tty
This makes it easy to use `glog` in a pipe as replacement for `git log
--oneline`, for example to count the commits.
2022-12-27 04:27:21 +01:00
aa28483381 zsh:p10k: Support mullvads VPN network interface 2022-12-26 23:53:10 +01:00
73c0864c8b git: Add https-and-ssh to setup origin
Sets up origin so that it fetches over https but pushes over ssh. This
way unlocking the ssh key is only needed when really necessary.
2022-12-01 01:27:28 +01:00
8c0cd77700 zsh:alisa: Do not show line numbers in less
I rarely need them and can still activate them manually.
2022-11-14 13:03:02 +01:00
7e0dcacc09 zsh:alias: Add gha for git add -p
Similar to the `<leader>gha` ("git hunk add") mapping in my vimrc.
2022-11-11 16:44:48 +01:00
b8d2fc28df zsh:alias: Sort git aliases 2022-11-11 16:44:34 +01:00
6aac7e7848 zsh:alias: Add gco for git checkout 2022-11-08 13:50:54 +01:00
b22085777e git:checkout-worktree: Remove tmp dir on error
When the git-worktree call exits with an error we can delete the
temporary directory as nothing is in it.
2022-10-27 23:52:17 +02:00
c41e395325 vim:keys: Use non-vi versions of backward delete
The `vi-` versions stop working after using `push-input` and trying to
edit the reappeared line.

This could be an upstream bug, as I can recreate it with `zsh -f`.
2022-10-21 17:33:57 +02:00
1930c8758f zsh:keys: Make shift-return act like return 2022-10-21 11:05:18 +02:00
350dd257f0 zsh:keys: Change ctrl-dot sequence to libtermkey 2022-10-21 01:25:36 +02:00
49e8e3a756 zsh:keys: Move through dirs like vims jumplist 2022-10-21 01:25:00 +02:00
286baf335f zsh:keys: Shift-{,Back}space should act like w/o 2022-10-21 01:23:43 +02:00
8651b073eb zsh:keys: Rely more on terminfo and use libtermkey
Introduce first mapping that follows the 'fixed keyboard input'[^1]
sequences. They allow the differentiation of all keys with each modifier
without gotchas like `tab` send the same sequence as `ctrl-i`.

[^1] - https://www.leonerd.org.uk/hacks/fixterms/
2022-10-21 01:22:52 +02:00
658797bda2 zsh:keys: Use vi- variants of navigation binds
They seem to be more consistent in doing the same/reversed thing when
triggering them backwards.
2022-10-21 01:22:51 +02:00
e15fc71054 zsh,git: Add git-make-fork 2022-10-17 17:28:31 +02:00
61e8ccc176 zsh:glog: Add bindings for faster navigation 2022-10-15 19:01:18 +02:00