aboutsummaryrefslogtreecommitdiff
path: root/src/config/model.rs
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@hey.com>2026-08-10 00:55:28 +0200
committerGitHub <noreply@github.com>2026-08-10 01:55:28 +0300
commitf5067ed829ae5743499916b941b2310c50681f29 (patch)
tree1695386cd3256ea9be1916e4385d1bbbe90d8748 /src/config/model.rs
parente48d83067a5a9b05dfd0a82761068866ab2d294d (diff)
feat: add move tab keybind actions (#2561)
* feat: add move tab keybind actions Add optional keys.move_tab_previous/move_tab_next actions that reorder the active tab one position, wrapping at either end. Reuses the existing tab.move runtime path that mouse drag reordering already drives. * fix: exit navigate mode on single-tab move attempts
Diffstat (limited to 'src/config/model.rs')
-rw-r--r--src/config/model.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/config/model.rs b/src/config/model.rs
index 16aa1d7d..0b237376 100644
--- a/src/config/model.rs
+++ b/src/config/model.rs
@@ -393,6 +393,10 @@ pub struct KeysConfig {
pub previous_tab: BindingConfig,
/// Select the next tab. Default: "prefix+n".
pub next_tab: BindingConfig,
+ /// Move the active tab one position toward the front. Unset by default.
+ pub move_tab_previous: BindingConfig,
+ /// Move the active tab one position toward the back. Unset by default.
+ pub move_tab_next: BindingConfig,
/// Switch to tab 1-9. Default: "prefix+1..9".
pub switch_tab: BindingConfig,
/// Switch to workspace 1-9 from prefix mode. Unset by default.
@@ -521,6 +525,10 @@ pub(crate) struct KeysConfigOverlay {
#[serde(skip_serializing_if = "Option::is_none")]
next_tab: Option<BindingConfig>,
#[serde(skip_serializing_if = "Option::is_none")]
+ move_tab_previous: Option<BindingConfig>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ move_tab_next: Option<BindingConfig>,
+ #[serde(skip_serializing_if = "Option::is_none")]
switch_tab: Option<BindingConfig>,
#[serde(skip_serializing_if = "Option::is_none")]
switch_workspace: Option<BindingConfig>,
@@ -627,6 +635,8 @@ impl<'de> Deserialize<'de> for KeysConfig {
apply_field!(rename_tab);
apply_field!(previous_tab);
apply_field!(next_tab);
+ apply_field!(move_tab_previous);
+ apply_field!(move_tab_next);
apply_field!(switch_tab);
apply_field!(switch_workspace);
apply_field!(close_tab);
@@ -729,6 +739,8 @@ impl KeysConfig {
copy_effective_action_field!(rename_tab, keybinds.rename_tab);
copy_effective_action_field!(previous_tab, keybinds.previous_tab);
copy_effective_action_field!(next_tab, keybinds.next_tab);
+ copy_effective_action_field!(move_tab_previous, keybinds.move_tab_previous);
+ copy_effective_action_field!(move_tab_next, keybinds.move_tab_next);
copy_effective_indexed_field!(switch_tab, keybinds.switch_tab);
copy_effective_indexed_field!(switch_workspace, keybinds.switch_workspace);
copy_effective_action_field!(close_tab, keybinds.close_tab);
@@ -1025,6 +1037,8 @@ impl Default for KeysConfig {
rename_tab: BindingConfig::one("prefix+shift+t"),
previous_tab: BindingConfig::one("prefix+p"),
next_tab: BindingConfig::one("prefix+n"),
+ move_tab_previous: BindingConfig::empty(),
+ move_tab_next: BindingConfig::empty(),
switch_tab: BindingConfig::one("prefix+1..9"),
switch_workspace: BindingConfig::empty(),
close_tab: BindingConfig::one("prefix+shift+x"),