Commit Graph

110 Commits

Author SHA1 Message Date
0c8d1f4292 tmux: Put some parts in version >= 3.3 checks
Ubuntu 22.04 is shipped with 3.2a... There might be more issues with
that version, but these were the ones I could find for now.

Tmux commits needed:
- c03b57465bdf/866117636e47 ("Add different command historys for
  different types of prompts ("command", "search" etc). From Anindya
  Mukherjee.") for `prompt-history-limit`
- e06a4e041c68 ("Set mouse_x and mouse_y on the status line, GitHub
  issue 2913.") for mouse_x in MouseDragEnd1StatusDefault binding
- 9f6164a05cc0 ("Make send-keys without any arguments send the key it is
  bound to (if any). GitHub issue 2904.") for `C-d`, `Enter` bindings
2025-03-13 14:33:26 +01:00
cd930fc9e8 tmux: Fix pane <-> window confusion in comment 2025-01-29 17:12:28 +01:00
6ff2aa3527 tmux: Cycle windows with Alt-Page{Up,Down}
Also change the only other use of PPage (i.e. PageUp) to PgUp. PageUp
and PageDown would probably be nicest, but I like that PgUp and PgDn are
of equal length. I dislike NPage and PPage.
2025-01-29 17:12:28 +01:00
c093a4ea37 tmux: Select last window with prefix+[0-9] too
This is already the case with M-[0-9].

prefix+0 was also still selecting window 0.
2025-01-22 14:54:29 +01:00
1d86941a07 tmux: Remove unneeded semicolon 2024-11-06 13:33:54 +01:00
79977eb81f tmux: Unbind <prefix> + arrow keys
I don't use them.
2024-10-21 17:14:17 +02:00
92289052ca tmux: Make <prefix>[hjkl] not repeatable
This is more than often annoying. For example when switching from a fzf
pane to a vim pane (i.e. needing these bindings instead of `C-[hjkl]`)
and then trying to move the cursor.

Reverts: 048933e67d ("tmux: Make `<prefix>[hjkl]` bindings repeatable")
2024-10-21 17:14:17 +02:00
91be5135eb tmux: Remove completed TODO
Fixed: 7dcd00058f ("tmux:TODO: Do not modify selection when
scrolling")
Fixed-by: aa901099b0 ("tmux: Use C-[ey] for scrolling with the wheel")
2024-10-18 16:13:35 +02:00
3e9dcaff9d tmux: Paste primary selection with middle mouse
Similar to everywhere else, paste the primary X selection (XA_PRIMARY)
instead of the most recent tmux paste buffer.

TODO: Forward event to 'root' key-table to prevent code duplication
2024-10-18 16:13:35 +02:00
012d913901 tmux: Get rid of "Not in a mode" error
The copy command should only be executed when not in a mode (i.e.
alternate?). This gets rid of the error message "Not in a mode" when
double/triple clicking inside of vim etc..
2024-10-18 16:13:35 +02:00
37cb526728 tmux: Unbind default DoubleClick bindings
When switching to the 'SecondClick' event in 4b8e877305 ("tmux: Use
SecondClick instead of DoubleClick event"), I forgot to add an `unbind`
of the default binding that was previously overwritten. Since I just
resourced my config I didn't notice.
2024-10-18 16:13:35 +02:00
aa901099b0 tmux: Use C-[ey] for scrolling with the wheel 2024-10-14 09:38:41 +02:00
9bc59bec72 tmux: Use 1-based indices for panes too 2024-10-07 13:23:14 +02:00
c273c3ac52 tmux: Manually "backport" scroll-middle if missing
First working draft
2024-09-18 16:30:45 +02:00
f5673c2082 tmux: Respawn dead pane on Enter 2024-09-18 15:16:41 +02:00
c6b317f794 tmux: Fix C-e & C-y bindings
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.
2024-09-15 22:44:52 +02:00
cab360ecf7 tmux: Require confirmation before killing a pane
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.
2024-08-30 18:14:20 +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
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
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
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
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
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
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
dc24dea0de tmux: Highlight zoomed pane in status more
Additionally to underlining it, highlight it by using a yellow
background.
2024-03-21 15:53:38 +01:00
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