Commit Graph

1205 Commits

Author SHA1 Message Date
1e4934989b tmux:textobjs: Do nothing when sitting on a space
When the cursor sits on a space character on `iw`, vim does nothing.
2024-08-30 18:14:19 +02:00
c106639a30 tmux:textobjs: Fix word & WORD edge cases 2024-08-30 18:14:19 +02:00
9d0631e858 tmux: Copy multi-click selection into primary
Also split the MouseDragEnd1Pane binding so that the full xclip
arguments can be written out to stay consistent.
2024-08-26 12:12:14 +02:00
4b8e877305 tmux: Use SecondClick instead of DoubleClick event
Make the word selection instant by changing the mouse event. If a third
click follows, the selection just changes to the full line.
2024-08-26 12:12:14 +02:00
faee7ea2ea tmux: Reorder prefix setting to top of bindings 2024-08-26 12:02:57 +02:00
41360b8278 tmux: Group options setting 2024-08-26 12:02:57 +02:00
873021ba80 tmux: Do not copy-and-cancel after a multi click
If I select a word or line with a double or triple click, I want it to
stay selected.
2024-08-26 12:02:50 +02:00
48d2ccec6c git: Update email address 2024-07-25 22:24:35 +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
c1d91fa934 vim:setts: Re-enable 'wrap'
I don't remember why I turned it off. But currently I enable it a lot.
2024-07-11 19:09:36 +02:00
1075264593 vim:setts: Add / to 'formatoptions'
Do not insert the comment leader on 'o' on trailing inline comments.
2024-07-11 19:09:32 +02:00
120285c478 tmux:textobjs: Do not use scroll_region
scroll_region_{upper,lower} are only modified by the DECSTBM escape
sequence:

> This control function sets the top and bottom margins for the current
> page. You cannot perform scrolling outside the margins.

And are 0 and pane_height - 1 otherwise. Tmux implements these such that
command output can't be displayed outside these margins, but the cursor
in copy-mode can. This means that using them to check if the cursor is
at the very top or bottom can break in certain situation (even those
seem extremely rare since I have never heard of this escape sequence).

Get rid of them and just use 0 and the pane height.

[1]: https://vt100.net/docs/vt510-rm/DECSTBM.html
2024-07-05 14:26:05 +02:00
7565ae2f6f tmux: Move textobj simulation into own textobjs.sh 2024-07-05 14:26:04 +02:00
4e8ab80c66 tmux: Fix edge cases in paragraph text-object
Also add comments explaining the history & pane position checks in the
C-y and C-e bindings, since I used those and had to rethink about what
they're doing.
2024-07-05 14:26:04 +02:00
b0b0a2ebea tmux: Formatting: Break long if-statements 2024-07-04 14:46:59 +02:00
e04953c123 tmux:yank: Add note about text object simulation 2024-07-04 14:46:58 +02:00
ec637ad1c8 tmux: Support repeatable yank motions via yank.sh
Implementing logic inside tmux's config starts to become tedious with
growing complexity. Introduce a shell script that handles the logic of
the (now also repeatable) vim-like bindings.
2024-07-04 14:46:58 +02:00
91d34358ec tmux: Use %1 instead of %%
According to the manpage all occurrences of `%1` are replaced, but only
the first of `%%`. The binding also worked with `%%`, but better stick
to the docs.
2024-07-04 14:46:58 +02:00
4f5d853823 tmux: Support yy in copy-mode-vi 2024-07-04 11:46:43 +02:00
c3ae99aa94 tmux: Fix broken target window flag
tmux stopped supporting format strings for the -t flag
2024-05-29 14:34:47 +02:00
96de70a433 git:column: Fill columns before rows
This is way easier to parse even if it means that I have to potentially
scroll more.
2024-05-24 10:44:55 +02:00
ec4bb20625 zsh:alias: Add TODO note to fragile rm condition 2024-05-12 21:00:12 +02:00
f000b53882 zsh:alias: Only add flags to rm, not aliased trash 2024-05-12 20:57:04 +02:00
46da4a617d zsh:alias: Disable CORRECT_ALL for mkdir
It's really annoying if it tries to correct me when I create a new
directory that is named similar to an existing one.

Group together aliases that add a precommand modifier.

Since `mkdir` receives the `-p` flag already via `add_flags` the `md`
alias can directly alias to `mkdir` instead.
2024-05-10 13:22:45 +02:00
6b25a2ce4e zsh:alias: Move add_flags section to the bottom
This way the commands can get aliased in other ways first and then get
their flags added.
2024-05-10 13:17:05 +02:00
2fabe6dd4c tmux: Add notes to some bindings
This has the benefit that these bindings now show up in the output of
`list-keys -N` (bound to `<C-a>?`).
2024-05-02 11:21:49 +02:00
0b89388db0 tmux: Bind <C-o> to focus last-window 2024-05-02 11:21:49 +02:00
19e3fbe7a0 zsh:alias: Update undescriptive comment 2024-04-26 14:05:33 +02:00
2aece4b672 zsh:alias: Add lsd to list all directories 2024-04-26 14:05:29 +02:00
31fcce9491 glog: Put angle brackets around email addresses
This makes it easier to copy the line and directly use it in git
trailers (e.g. Reviewed-by).
2024-04-25 11:40:26 +02:00
4251fec30e tmux: Change <C-a>! to place behind current window
Analog to <C-a>c the new window should be placed behind the current one.
2024-04-18 08:35:19 +02:00
15af1af190 git: Output in columns
Supported git commands should print their output in columns (e.g.
git-branch).

I am still unsure if I'd like to keep the option to fill rows first. The
default behaviour is columns first and `ls` does this too for example.
But I think that it makes more sense to fill the rows first, especially
with sorting by committerdate to delay the need to scroll as far as
possible.
2024-04-09 15:22:17 +02:00
b6cfd9c74a git: Sort branches by reverse committerdate 2024-04-09 15:22:17 +02:00
9db4b32f02 vim:aucmd: Make highlighting toggleable 2024-04-03 13:34:33 +02:00
06b987afa8 vim:aucmd: Put often used <cword> into variable 2024-04-03 13:34:19 +02:00
e84eaba7a2 vim:aucmd: Don't overwrite constants when sourcing
When resourcing the vimscript (i.e. writing it) currently three errors
are printed that constant values cannot be overwritten.
2024-04-03 13:32:23 +02:00
6dd226d305 zsh:diffcmds: Quote only once, for real now 2024-03-24 18:27:41 +01:00
e5593e1c98 zsh:diffcmds: Refactor: make code less redundant
Instead of always operating on `$@` and using complex parameter
substitutions, split `$@` once into two arrays and use those for
everything further.
2024-03-24 18:27:37 +01:00
52e5d1ab4d zsh:diffcmds: Do the quotation only once 2024-03-24 18:16:02 +01:00
09f437a860 zsh:diffcmds: Do not unquote pipes in args list
diffcmds echo foo %% cat -- '|'

is expected to output `foo | cat` and not `foo`.

Fix this by changing the order of the substitution and {,un}quoting.
2024-03-24 17:38:16 +01:00
ee31064286 zsh:diffcmds: Improve comments and example 2024-03-24 17:29:18 +01:00
f1f9f36d43 vim:aucmd: Reorder *Highlight* functions
Also improve their comments.
2024-03-24 16:56:12 +01:00
0006a778f9 vim:aucmd: Improve highlighting on mode changes
When entering visual mode it does not really make sense to keep the
cword highlighting but it should restart automatically (i.e. without
CursorMoved) when leaving back out of visual mode.

About directly starting selection highlighting I am still unsure since I
rarely ever want to highlight only one character and it could decrease
performance.
2024-03-24 16:56:12 +01:00
6260c84f3a vim:aucmd: Clear highlights on exiting visual mode
When exiting visual mode I want to clear the highlights of the visual
selection. As this is done automatically now, <Esc> does not need to do
it (and i had problems with keys.vim executing ClearHighlights because
of the script variables).

This reverts commit b3f1a469db ("vim:keys: Clear highlights on
normal-mode Esc").
2024-03-24 16:56:11 +01:00
bfccb0f089 vim:aucmd: Support multi-line selection highlight 2024-03-24 16:47:49 +01:00
4b8ab18392 tmux: Fix MouseDragEnd1StatusDefault for v3.4
move-window does not support format parsing. Apparently it was a bug
that it did in the past. Fix this by using run-shell - which I hate as a
solution.
2024-03-24 16:07:12 +01:00
ffc9877a70 git:last-changed: Print committer name too
I am still unsure if I want the author or committer name. For the date I
think it makes sense to have the committer date since it reflects better
when the branch last changed.
2024-03-24 13:50:12 +01:00
234f452434 git:make-fork: Add call to git-https-and-ssh
When setting up the remotes the fetch url can use https since the fork
will be public anyways. This delays a prompt for the ssh key until it is
really necessary.
2024-03-24 13:46:42 +01:00
803b35d3d5 zsh:p10k: Empty the second line of RPROMPT
I often get annoyed when I try to copy the command I typed but the
timestamp is also copied (e.g. with tmux line selection). Move the time
segment to the very right of the first line of RPROMPT which empties the
second line completely.
2024-03-22 10:09:16 +01:00
48acd729fe tmux: Do not enter copy-mode with Escape
I rarely use this binding as by now I have the muscle memory of `<C-a>[`
to enter copy-mode and since my brain thinks that I can press Escape if
I accidentally press the prefix and I get disappointed every time.
2024-03-22 10:09:16 +01:00