If :h 'spelllang' is something else, do nothing.
A possible future improvement could be to keep a list of the languages
to cycle between and first adding any other languages to this list so
that one could return to the original setting. I see this especially
useful when the current setting is `en,de`.
Apparently I broke them in commit 4e8ab80c66 ("tmux: Fix edge cases
in paragraph text-object") by adding the comments. Through them the
bindings were not set in place since the binding stopped with the
comment (I guess?). Weirdly I do not get an error message and the
default bindings stay, so I am not sure what exactly happens. This could
also be due to a version change from 3.3a to 3.4.
Fix the bindings by starting a code block instead of just escaping the
newline.
Do this also everywhere else to prevent errors in the future.
`copy_exec` was stupid since it brought unnecessary shell overhead even
though it was meant to improve performance (one could argue that it is
not even necessary here).
Continue the idea of reducing calls to `tmux` by "globally" chaining
together all copy-mode commands instead of doing it only "locally" with
`copy_exec`. This has the added benefit that also calls having arguments
can be included and merged.
Make ][ and ]] work like they used to with the new functionality through
a workaround.
The problem is that recursive mappings are evaluated at runtime not
"compiletime" - which is what I would need in this situation.
I still want both mappings blocks so that they are not entangled and I
can turn each one off without affecting the other.
I use the [[ & etc. mappings to jump between function definitions in C.
This works as long as the braces are put on a newline (like in the
kernel coding style guide).
Relax the mappings for opening braces to jump to unindented lines with
an opening brace to cover also different style guides.
It happened to me multiple times that I closed a pane without actually
wanting it via a (too) quick <C-d>.
Activate remain-on-exit so that I have to press <C-d> twice before the
pane is actually killed. Dead panes can be recovered with
`respawn-pane`.
Will see how this goes - could be annoying.
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
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.
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.
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.
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.