Commit Graph

134 Commits

Author SHA1 Message Date
83945840b8 tmux: Rudimentary vim's text object simulation
Add non-robust emulation of vim's v_i{w,W,p,quote,'}.

TODO: Is there a better way of doing else-if?
2024-03-21 15:53:38 +01:00
8c33a9bf96 tmux: Update tmux-resurrect
With commit dd36a4561b0b ("use XDG_DATA_HOME for resurrect-dir path")
the default location of resurrect-dir changed to
$XDG_DATA_HOME/tmux/resurrect as long as $HOME/.tmux does not exist.
This makes manually hard-coding resurrect-dir obsolete.
2024-03-21 11:02:37 +01:00
3ec9dd6305 tmux: Place resurrect files in XDG_DATA_HOME
Unfortunately I need to hardcode XDG_DATA_HOME as resurrect-dir does not
support environment variables except for HOME and HOSTNAME.
2024-03-21 11:02:37 +01:00
45901f95df tmux: Better window dragging through swap-window 2024-02-29 13:00:16 +01:00
1d00e201a7 tmux: Support dragging into status bar
Additionally to dragging a window onto the target destination, add
support to drag it further than the outermost windows.
2024-02-28 16:07:31 +01:00
6d60e14824 tmux: Use move-window for window dragging
Use move-window for window dragging instead of a loop and swap-window.
When using -a or -b (i.e. after or before) the target can be occupied
and the windows are reordered automatically.
2024-02-28 16:07:31 +01:00
58297ce697 tmux: Place new window after the current one 2023-07-10 16:04:44 +02:00
f6c627bd53 tmux: Use hex values for colors
Taken from my st fork (Originally the tango theme I believe).
2023-06-27 18:20:38 +02:00
a2c27496eb tmux: Reorder windows by dragging on status line 2023-06-15 15:32:03 +02:00
6b3f72c27c tmux: Select last window if target is current 2023-06-15 13:47:31 +02:00
88e991f944 tmux: Add bindings to swap window with prev/next 2023-06-15 12:09:44 +02:00
6a36867d4d tmux: Select windows with Alt-[0-9] 2023-06-15 12:04:23 +02:00
b4eba71b16 tmux: C-v should start the selection if inactive 2023-06-14 12:24:08 +02:00
d4d29b0c64 tmux: Use e prefix when comparing numbers 2023-06-14 11:17:23 +02:00
998c1c3fda tmux: Better simulate vim's C-e & C-y
Keep the cursor position or selection while scrolling.
2023-06-14 10:58:07 +02:00
d85dd89416 tmux: Make selfinsert binding C-v repeatable 2023-06-07 11:58:58 +02:00
52963bf2be tmux: Mimic vim's Y in copy-mode-vi 2023-05-22 15:13:35 +02:00
6ec99f3af7 tmux: Emulate normal-mode y without selection
Try to mimic vim's normal and visual mode behaviour of `y`.

Set 'copy-command' for the copy-pipe commands to fall back to.
2023-05-22 15:12:59 +02:00
3944156168 tmux: Replace selfinsert.sh with a command-prompt 2023-05-22 14:47:48 +02:00
33be2cf3be tmux: Cancel copy-mode with insert-mode bindings 2023-05-22 14:47:13 +02:00
0bb92e80c8 tmux: Clean up some comments 2023-05-22 14:02:17 +02:00
cc299641e5 tmux: Remove code redundancy with hidden variable 2023-05-22 13:49:37 +02:00
1a9780925a tmux: Fix selfinsert key-table
Some keys were missing from the key-table (e.g. C-[hjkl]) as they were
set later in the config.

Fix by moving the script execution to the bottom of the config.
2023-05-22 13:24:30 +02:00
de001db473 tmux: Underline windows in status line when zoomed
I sometimes forget that windows are in zoomed state as I was missing a
visual indicator. Underline the window names in the status line to fix
that.

TODO: Move added code bit into a variable to prevent redundancy. I was
      not able to get it to be expanded, in contrast it would just
      insert the text literally.
2023-03-22 12:31:08 +01:00
4808ba95a5 tmux:TODO: Display when pane is in fullscreen mode
Sometimes I forget that I maximized a pane as there is no visual
indicator.
2023-02-27 14:08:40 +01:00
7dcd00058f tmux:TODO: Do not modify selection when scrolling 2023-02-27 14:07:04 +01:00
67b474e7f6 tmux: Revert "Remove unused status-style"
This reverts commit b4cbd08d3b.

I am not sure why I thought this was irrelevant. But when testing I did
not properly unset it or restart the server, so nothing changed when I
reloaded tmux.conf.

Conflicts:
	.config/tmux/tmux.conf
2023-02-24 10:14:05 +01:00
c6e988e663 tmux: Use user options to define colors only once 2023-01-10 12:32:08 +01:00
b4cbd08d3b tmux: Remove unused status-style 2023-01-10 12:32:08 +01:00
9daeba47ea tmux: Number windows with 1-based indices
It is counter intuitive to have to reach to the right for the first
window.
2023-01-10 12:32:03 +01:00
f6db506f26 tmux: Run resurrect-save on detach in background
Shorten the time it takes to detach.
2023-01-04 11:32:30 +01:00
aee241f3c3 tmux: Fix typo in miswritten extended-keys
extended_keys -> extended-keys
2022-10-21 15:15:13 +02:00
8de8151cbe tmux: Activate extended_keys
With it libtermkey/libtickit[^1] mappings are supported.

[^1] - https://www.leonerd.org.uk/code/libtermkey/
[^2] - https://www.leonerd.org.uk/hacks/fixterms/
2022-10-21 01:21:48 +02:00
764bc6d9b7 tmux: Send 5xup when scrolling in alternate mode 2022-09-19 13:07:35 +02:00
832d1cfd0d tmux: Write prompt history to XDG_DATA 2022-09-19 13:04:29 +02:00
a1e431d3e1 tmux: Use shell script to complete selfinsert
Use a short shell script to complete the `selfinsert` keytable by
binding all keys that have a mapping in the root table.
2022-09-08 18:36:37 +02:00
048933e67d tmux: Make <prefix>[hjkl] bindings repeatable
I sometimes need the `<prefix>[hjkl]` bindings over `C-[hjkl]` (e.g. vim
insert mode). Then it is nice to have them repeatable when navigating to
a pane further away.
2022-09-08 16:41:06 +02:00
eca58c09f8 tmux: Scroll only 5 lines when entering copy-mode
Only scroll 5 lines instead of a full page when entering copy-mode
through the wheel as a full page was too disorienting.

TODO: Pass `WheelUpPane` after entering copy-mode instead of redundantly
executing it's bound command.

Somehow neither of the following worked:

  send -XM WheelUpPane
  send -X WheelUpPane
2022-09-08 16:37:57 +02:00
b807497984 tmux: Mimic copy-mode -e when using the wheel
`copy-mode -e` annoyed me, as it happened sometimes that I would hold
down `C-d` to scroll down, only to close the shell and pane when
reaching the bottom.

But in principal I do like the idea of it and missed the feature when
reaching the bottom by using the scroll wheel.

Change the `WheelDownPane` in copy-mode to exit when the bottom is
reached.
2022-09-08 16:31:42 +02:00
7d58be4365 tmux: Scroll without selecting the pane 2022-09-08 15:41:53 +02:00
17fd0409a4 tmux: Make { and } repeatable 2022-07-14 14:24:59 +02:00
a8f6973968 tmux: Use pane-border as indicator for {copy,sync}
In tmux version 3.2 all style options were changed to string
options, making them support formats.[^1]

From that version on, use the pane-borders as indicator for the
{copy,sync}-mode instead of the prefix_highlight plugin.

Keep the pure style fallback, as Ubuntu 20.4 for example still only
ships with version 3.0a.

[^1]: https://github.com/tmux/tmux/commit/f03b61131b34079
2022-07-12 21:00:10 +02:00
747ffd01e3 tmux:prefix_highlight: Invert fg,bg + red for sync
- Invert the prefix_highlight colors so that it is less obtrusive.
 - Use `brightred` for the background of the sync-mode indicator.

This way the prefix, copy-mode and sync-mode indicators are visually
differentiable.
2022-07-12 21:00:10 +02:00
18625091ed tmux: Add a 'resize mode' similar to my i3 config
Add a 'resize mode' that behaves similar to the one in my i3 config.
When pressing the binding `<prefix>r`, a new key-table is selected that
allows resizing with `hjkl` as well as choosing the different layouts
directly over the number row.
2022-07-12 21:00:09 +02:00
e0fdd45e6c tmux: Add binding to synchronize panes
Synchronize the panes in the current window with `<prefix>S`.
2022-07-12 21:00:09 +02:00
d9ea048411 tmux: Also display indicator for copy-mode 2022-07-12 21:00:09 +02:00
e609efc385 tmux: Also display indicator for synchronize-panes
Also display an indicator when synchronize-panes is turned on in the
status bar, not only for the prefix.
2022-07-12 21:00:08 +02:00
f2978fa030 tmux: Remove unneeded prefix_highlight_*fix
Remove unneeded `prefix_highlight_output_{pre,suf}fix` option, as a
space is the default value from the `tmux-prefix-highlight` plugin.
2022-07-12 21:00:08 +02:00
75611be2f8 tmux: Use short command variants
Use short variants of commands and get rid of redundant `-T prefix` flag
to `bind`.
2022-07-12 21:00:08 +02:00
f429da3fd9 tmux: Use short command variants
Use short variants of commands and get rid of redundant `-T prefix` flag
to `bind`.
2022-07-12 21:00:08 +02:00