Commit Graph

1655 Commits

Author SHA1 Message Date
465e5e1330 kitty: Better font size mappings (current/all)
More fine-grained control and mappings for current terminal only.
2025-06-09 19:17:16 +02:00
616298df72 i3:multi-monitor: Send only one i3-msg command
Moving and then switching in a separate command flickered sometimes.
2025-06-06 12:03:41 +02:00
a67f8c9ec6 i3: Simulate monitor-independent workspaces
Often when I want to open a new workspace, I look at my bar to see which
workspaces are still free. This does not work sometimes when having
multiple monitors connected, as workspace numbers are unique between all
outputs.

Add a script that handles workspace switching/moving by prepending the
index with the index of the current monitor.
2025-06-05 17:43:24 +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
6b98838f7e vim:keys: Remove unneeded mappings
These were commented out already for longer. For `(` I have delimitMate
and the `<CR>` mapping conflicts with the one from coc.nvim (which
includes the `<C-G>u`)
2025-06-02 20:59:43 +02:00
f0ec75aa9c vim:keys: Map <leader>d also in visual mode 2025-06-02 20:59:43 +02:00
533e82cb81 vim:keys: Add :keeppatterns to substituting vmaps
All of these should not modify @/.
2025-06-02 20:59:43 +02:00
e0e1e5d971 vim:keys: Fix <Cmd> vmaps
When switching to <Cmd> for mappings in fc9874bf97 ("vim:keys: Use
<Cmd> for plain command mappings") I forgot that the previously inserted
selection range marks (i.e. '<,'>) are missing now. This broke vmaps
that used :substitute without having added them manually.

Since <Cmd> has some performance benefits, I want to keep it and add the
missing marks where needed.
2025-06-02 20:59:37 +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
c89d3b550b i3: Add note about minimal kitty version 2025-05-30 01:34:41 +02:00
e49e8a8ef0 hooks:pre-push: Put -E flag closer to --grep
Since they belong together.
2025-05-30 01:31:40 +02:00
136b56688a hooks:pre-push: Switch back to /bin/sh
It's not worth it to sacrifice the portability of the script for a bit
of integer-aid.
2025-05-30 01:31:17 +02:00
d4d21ceb1d hooks:pre-commit: Update to git's current version
The template has changed since I've added it.
2025-05-30 01:21:48 +02:00
4fba1bbf13 hooks:pre-commit: Fix symlink diff-filter
Renames are uninteresting for the link check. But we do care about
change in the type of the file.
2025-05-30 00:53:52 +02:00
a37080c948 hooks:pre-commit: Check for absolute links too
I don't really want any absolute links here.
2025-05-30 00:51:41 +02:00
88be20672a hooks:pre-commit: Fix non-tab indentation 2025-05-30 00:37:29 +02:00
6cb3cbe30a kitty-cwd: Fix accidental absolute symlink 2025-05-30 00:27:05 +02:00
6ad28b64a7 firefox: Recognize .nas as valid TLD 2025-05-29 17:36:36 +02:00
f75130ea73 zotero: Add user.js that sets recursiveCollections 2025-05-29 17:34:14 +02:00
9dc8e71ce6 vim:keys: Map <C-w>! to move window to new tab
I memorized tmux's <prefix>! mapping, but always forget how it is done
in vim.
2025-05-28 14:05:40 +02:00
3d3ba75abb git: Use commit.template for a 2nd newline
When I write commit messages in vim, I often use gwap to format the
message body. This breaks if there is no empty line between the body and
the following "Please enter the commit message for your changes..."
comment.

So, to not always have to add this empty line first, I use a
commit.template file that simply contains one empty line.
2025-05-28 14:05:39 +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
a34a00eae6 i3: Fix opening kitty in the current working dir
Since I run kitty with --single-instance, xcwd does not work for it.
Replace it with a short script that retrieves the CWD for the focused
window through the remote-control ls command.

This changes the current behaviour slightly, since now only terminals
are used and not any X window (which I rarely used or needed) and that
the working dir of the shell running in kitty will be used and not of
any deeper children. I'm still unsure if I want the latter back, but
will figure this out in the future.

This is an addendum to 0139294831 ("Use kitty instead of st as
terminal").
2025-05-27 18:24:06 +02:00
0c17ae8280 *: Use xargs instead of while read one-line loops 2025-05-27 17:00:35 +02:00
e9f05d5d08 git: Add ls -> ls-files alias 2025-05-23 18:19:38 +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
bbc6d5c9e0 git: Fix working directory of shell aliases
In git aliases, shell commands are executed from the top-level directory
of the repo. Because of this, something like `git glog -- file` didn't
work in subdirectories.

Fix this by creating a wrapper script that first changes into
$GIT_PREFIX before executing the script. Since (currently) the only
use-case is to launch the functions in `autoload/git/`, most of the path
could move into the script, making the git config a lot cleaner.
2025-05-23 16:30:58 +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
9bf853a8d2 git: Fold sections in vim via modeline 2025-05-23 13:33:02 +02:00
7158abd611 git: Reorder aliases
Bring all blocks together and place shorter alias variants behind longer
ones - ignore the shorter ones in the sorting.

Remove the comment above `autosquash` because the command is fairly
descriptive and it is the only comment and I don't really know how to
format the block then (since the comment is at the very top it looks
like it is for the whole block and I don't want to put a newline behind
`autofixup`).
2025-05-23 13:19:25 +02:00
fc60d4baf3 git: Add fetch-tags-only alias 2025-05-23 13:08:24 +02:00
0139294831 Use kitty instead of st as terminal
I decided to merge this without fast-forward (but still after a rebase)
to better keep the context of the block of commits needed after the
switch.

* kitty:
  README: Change terminal used to kitty
  kitty: Change to beam cursor
  kitty: Update mouse_maps to use Alt as kitty_mod
  kitty: Only set the mappings I need/use
  kitty: Change color scheme to modified Tango
  kitty: Enable close_on_child_death
  kitty: Make kitty startup fast
  i3: Switch to kitty
  i3: Save terminal related stuff in variables
  i3: Remove unneeded window class flag to st
  dircolors: Use a non-system color for DIR
  kitty: Configure to align with my st settings
  kitty: Add v0.42.0 default config
2025-05-22 17:03:08 +02:00
fb1000f660 README: Change terminal used to kitty 2025-05-22 17:00:56 +02:00
18c6a17562 kitty: Change to beam cursor
Otherwise the block cursor comes out now and then (e.g. in fzf).
2025-05-22 16:47:04 +02:00
711608d6c9 kitty: Update mouse_maps to use Alt as kitty_mod 2025-05-22 16:46:46 +02:00
a9998ed371 kitty: Only set the mappings I need/use 2025-05-22 16:41:20 +02:00
ab6eb1e844 kitty: Change color scheme to modified Tango
Colors taken from my st fork. Additionally make the magenta a bit more
saturated.

This reverts 428d75a090 ("dircolors: Use a non-system color for DIR").

Link: https://github.com/druckdev/st/blob/custom/config.h#L101-L119
2025-05-22 16:38:40 +02:00
000ac0f615 kitty: Enable close_on_child_death
Otherwise closing kitty takes forever on my system:

    > kitty -1 --instance-group no -o close_on_child_death=no &
    > kitty -1 --instance-group yes -o close_on_child_death=yes &
    > kitty_cmd="kitty -1 \
                       --wait-for-single-instance-window-close \
                       --instance-group"
    > zsh_cmd="zsh -ic exit"
    > hyperfine -N "$kitty_cmd no $zsh_cmd" \
                   "$kitty_cmd yes $zsh_cmd" \
                   "st -e $zsh_cmd"

    Benchmark 1: kitty -1 \
                --wait-for-single-instance-window-close \
                --instance-group no zsh -ic exit
      Time (mean ± σ):      5.543 s ±  0.023 s    [User: 0.002 s, System: 0.005 s]
      Range (min … max):    5.486 s …  5.570 s    10 runs

    Benchmark 2: kitty -1 \
                --wait-for-single-instance-window-close \
                --instance-group yes zsh -ic exit
      Time (mean ± σ):     509.9 ms ±  29.4 ms    [User: 1.0 ms, System: 2.2 ms]
      Range (min … max):   480.9 ms … 560.1 ms    10 runs

    Benchmark 3: st -e zsh -ic exit
      Time (mean ± σ):     475.0 ms ±  12.6 ms    [User: 304.3 ms, System: 171.5 ms]
      Range (min … max):   455.6 ms … 495.7 ms    10 runs

    Summary
      st -e zsh -ic exit ran
        1.07 ± 0.07 times faster than kitty -1 \
                --wait-for-single-instance-window-close \
                --instance-group yes zsh -ic exit
       11.67 ± 0.31 times faster than kitty -1 \
                --wait-for-single-instance-window-close \
                --instance-group no zsh -ic exit

Link: https://github.com/kovidgoyal/kitty/issues/378
TODO: Could the 500ms be decreased? (zsh related)
2025-05-22 16:32:59 +02:00
d89fd6653c kitty: Make kitty startup fast
Starting a new kitty process is quite slow. With --single-instance "new
invocations will instead create a new top-level window in the existing
kitty instance"[^1] to allow "kitty to share a single sprite cache on
the GPU"[^1], so that startup is almost instant.

For this to work best, launch one hidden "daemon" instance at startup so
that the kitty process is always running, even when no OS windows
exists.

[^1]: kitty(1)

Link: https://github.com/kovidgoyal/kitty/issues/330
2025-05-22 15:49:03 +02:00
9b0c97b003 i3: Switch to kitty 2025-05-22 01:13:45 +02:00
87ecc40627 i3: Save terminal related stuff in variables 2025-05-22 01:13:45 +02:00
f202f987c5 i3: Remove unneeded window class flag to st
This is the default already.
2025-05-22 01:13:45 +02:00