Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions default-plugins/compact-bar/src/action_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub enum ActionType {
ToggleFocusFullscreen,
ToggleFloatingPanes,
CloseFocus,
CloseUnfocused,
CloseTab,
ToggleActiveSyncTab,
ToggleTab,
Expand Down Expand Up @@ -78,6 +79,7 @@ impl ActionType {
ActionType::ToggleFocusFullscreen => "Toggle fullscreen".to_string(),
ActionType::ToggleFloatingPanes => "Show/hide floating panes".to_string(),
ActionType::CloseFocus => "Close pane".to_string(),
ActionType::CloseUnfocused => "Close other panes".to_string(),
ActionType::CloseTab => "Close tab".to_string(),
ActionType::ToggleActiveSyncTab => "Sync panes in tab".to_string(),
ActionType::ToggleTab => "Circle tab focus".to_string(),
Expand Down Expand Up @@ -111,6 +113,7 @@ impl ActionType {
Action::ToggleFocusFullscreen => ActionType::ToggleFocusFullscreen,
Action::ToggleFloatingPanes => ActionType::ToggleFloatingPanes,
Action::CloseFocus => ActionType::CloseFocus,
Action::CloseUnfocused => ActionType::CloseUnfocused,
Action::CloseTab => ActionType::CloseTab,
Action::ToggleActiveSyncTab => ActionType::ToggleActiveSyncTab,
Action::ToggleTab => ActionType::ToggleTab,
Expand Down
1 change: 1 addition & 0 deletions default-plugins/compact-bar/src/keybind_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ impl KeybindProcessor {
|action: &Action| matches!(action, Action::MoveFocus(Direction::Up)),
|action: &Action| matches!(action, Action::MoveFocus(Direction::Right)),
|action: &Action| matches!(action, Action::CloseFocus),
|action: &Action| matches!(action, Action::CloseUnfocused),
|action: &Action| matches!(action, Action::SwitchToMode(InputMode::RenamePane)),
|action: &Action| matches!(action, Action::ToggleFocusFullscreen),
|action: &Action| matches!(action, Action::ToggleFloatingPanes),
Expand Down
11 changes: 11 additions & 0 deletions default-plugins/configuration/src/presets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ keybinds clear-defaults=true {{
bind "r" {{ NewPane "Right"; SwitchToMode "Locked"; }}
bind "s" {{ NewPane "stacked"; SwitchToMode "Locked"; }}
bind "x" {{ CloseFocus; SwitchToMode "Locked"; }}
bind "o" {{ CloseUnfocused; SwitchToMode "Locked"; }}
bind "f" {{ ToggleFocusFullscreen; SwitchToMode "Locked"; }}
bind "z" {{ TogglePaneFrames; SwitchToMode "Locked"; }}
bind "w" {{ ToggleFloatingPanes; SwitchToMode "Locked"; }}
Expand Down Expand Up @@ -247,6 +248,7 @@ keybinds clear-defaults=true {{
bind "r" {{ NewPane "Right"; SwitchToMode "Normal"; }}
bind "s" {{ NewPane "stacked"; SwitchToMode "Normal"; }}
bind "x" {{ CloseFocus; SwitchToMode "Normal"; }}
bind "o" {{ CloseUnfocused; SwitchToMode "Normal"; }}
bind "f" {{ ToggleFocusFullscreen; SwitchToMode "Normal"; }}
bind "z" {{ TogglePaneFrames; SwitchToMode "Normal"; }}
bind "w" {{ ToggleFloatingPanes; SwitchToMode "Normal"; }}
Expand Down Expand Up @@ -394,6 +396,7 @@ keybinds clear-defaults=true {{
bind "d" {{ Detach; }}
bind "Space" {{ NextSwapLayout; }}
bind "x" {{ CloseFocus; SwitchToMode "Normal"; }}
bind "o" {{ CloseUnfocused; SwitchToMode "Normal"; }}
}}
shared_except "locked" {{
bind "{primary_modifier} g" {{ SwitchToMode "Locked"; }}
Expand Down Expand Up @@ -472,6 +475,7 @@ keybinds clear-defaults=true {{
bind "r" {{ NewPane "Right"; SwitchToMode "Normal"; }}
bind "s" {{ NewPane "stacked"; SwitchToMode "Normal"; }}
bind "x" {{ CloseFocus; SwitchToMode "Normal"; }}
bind "o" {{ CloseUnfocused; SwitchToMode "Normal"; }}
bind "f" {{ ToggleFocusFullscreen; SwitchToMode "Normal"; }}
bind "z" {{ TogglePaneFrames; SwitchToMode "Normal"; }}
bind "w" {{ ToggleFloatingPanes; SwitchToMode "Normal"; }}
Expand Down Expand Up @@ -609,6 +613,7 @@ keybinds clear-defaults=true {{
bind "d" {{ Detach; }}
bind "Space" {{ NextSwapLayout; }}
bind "x" {{ CloseFocus; SwitchToMode "Normal"; }}
bind "m" {{ CloseUnfocused; SwitchToMode "Normal"; }}
}}
shared_except "locked" {{
bind "{secondary_modifier} n" {{ NewPane; }}
Expand Down Expand Up @@ -668,6 +673,7 @@ keybinds clear-defaults=true {{
bind "r" {{ NewPane "Right"; SwitchToMode "Normal"; }}
bind "s" {{ NewPane "stacked"; SwitchToMode "Normal"; }}
bind "x" {{ CloseFocus; SwitchToMode "Normal"; }}
bind "o" {{ CloseUnfocused; SwitchToMode "Normal"; }}
bind "f" {{ ToggleFocusFullscreen; SwitchToMode "Normal"; }}
bind "z" {{ TogglePaneFrames; SwitchToMode "Normal"; }}
bind "w" {{ ToggleFloatingPanes; SwitchToMode "Normal"; }}
Expand Down Expand Up @@ -807,6 +813,7 @@ keybinds clear-defaults=true {{
bind "d" {{ Detach; }}
bind "Space" {{ NextSwapLayout; }}
bind "x" {{ CloseFocus; SwitchToMode "Normal"; }}
bind "m" {{ CloseUnfocused; SwitchToMode "Normal"; }}
}}
shared_except "locked" {{
bind "{primary_modifier} g" {{ SwitchToMode "Locked"; }}
Expand Down Expand Up @@ -871,6 +878,7 @@ keybinds clear-defaults=true {{
bind "r" {{ NewPane "Right"; SwitchToMode "Normal"; }}
bind "s" {{ NewPane "stacked"; SwitchToMode "Normal"; }}
bind "x" {{ CloseFocus; SwitchToMode "Normal"; }}
bind "o" {{ CloseUnfocused; SwitchToMode "Normal"; }}
bind "f" {{ ToggleFocusFullscreen; SwitchToMode "Normal"; }}
bind "z" {{ TogglePaneFrames; SwitchToMode "Normal"; }}
bind "w" {{ ToggleFloatingPanes; SwitchToMode "Normal"; }}
Expand Down Expand Up @@ -1003,6 +1011,7 @@ keybinds clear-defaults=true {{
bind "d" {{ Detach; }}
bind "Space" {{ NextSwapLayout; }}
bind "x" {{ CloseFocus; SwitchToMode "Normal"; }}
bind "m" {{ CloseUnfocused; SwitchToMode "Normal"; }}
}}
shared_except "normal" "locked" {{
bind "Enter" "Esc" {{ SwitchToMode "Normal"; }}
Expand Down Expand Up @@ -1049,6 +1058,7 @@ keybinds clear-defaults=true {{
bind "r" {{ NewPane "Right"; SwitchToMode "Normal"; }}
bind "s" {{ NewPane "stacked"; SwitchToMode "Normal"; }}
bind "x" {{ CloseFocus; SwitchToMode "Normal"; }}
bind "o" {{ CloseUnfocused; SwitchToMode "Normal"; }}
bind "f" {{ ToggleFocusFullscreen; SwitchToMode "Normal"; }}
bind "z" {{ TogglePaneFrames; SwitchToMode "Normal"; }}
bind "w" {{ ToggleFloatingPanes; SwitchToMode "Normal"; }}
Expand Down Expand Up @@ -1196,6 +1206,7 @@ keybinds clear-defaults=true {{
bind "d" {{ Detach; }}
bind "Space" {{ NextSwapLayout; }}
bind "x" {{ CloseFocus; SwitchToMode "Normal"; }}
bind "m" {{ CloseUnfocused; SwitchToMode "Normal"; }}
}}
shared_except "locked" {{
bind "{primary_modifier} g" {{ SwitchToMode "Locked"; }}
Expand Down
1 change: 1 addition & 0 deletions default-plugins/status-bar/src/one_line_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1268,6 +1268,7 @@ fn get_keys_and_hints(mi: &ModeInfo) -> Vec<(String, String, Vec<KeyWithModifier
action_key_group(&km, &[&[A::MoveFocus(Dir::Left)], &[A::MoveFocus(Dir::Down)],
&[A::MoveFocus(Dir::Up)], &[A::MoveFocus(Dir::Right)]])),
(s("Close"), s("Close"), single_action_key(&km, &[A::CloseFocus, TO_NORMAL])),
(s("Close Other Panes"), s("Close Other Panes"), single_action_key(&km, &[A::CloseUnfocused, TO_NORMAL])),
(s("Rename"), s("Rename"),
single_action_key(&km, &[A::SwitchToMode(IM::RenamePane), A::PaneNameInput(vec![0])])),
(s("Toggle Fullscreen"), s("Fullscreen"), single_action_key(&km, &[A::ToggleFocusFullscreen, TO_NORMAL])),
Expand Down
9 changes: 9 additions & 0 deletions default-plugins/status-bar/src/second_line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ fn get_keys_and_hints(mi: &ModeInfo) -> Vec<(String, String, Vec<KeyWithModifier
action_key_group(&km, &[&[A::MoveFocus(Dir::Left)], &[A::MoveFocus(Dir::Down)],
&[A::MoveFocus(Dir::Up)], &[A::MoveFocus(Dir::Right)]])),
(s("Close"), s("Close"), action_key(&km, &[A::CloseFocus, TO_NORMAL])),
(s("Close Other Panes"), s("Close Other Panes"), action_key(&km, &[A::CloseUnfocused, TO_NORMAL])),
(s("Rename"), s("Rename"),
action_key(&km, &[A::SwitchToMode(IM::RenamePane), A::PaneNameInput(vec![0])])),
(s("Toggle Fullscreen"), s("Fullscreen"), action_key(&km, &[A::ToggleFocusFullscreen, TO_NORMAL])),
Expand Down Expand Up @@ -691,6 +692,10 @@ mod tests {
KeyWithModifier::new(BareKey::Char('x')),
vec![Action::CloseFocus, TO_NORMAL],
),
(
KeyWithModifier::new(BareKey::Char('m')),
vec![Action::CloseUnfocused, TO_NORMAL],
),
(
KeyWithModifier::new(BareKey::Char('f')),
vec![Action::ToggleFocusFullscreen, TO_NORMAL],
Expand Down Expand Up @@ -741,6 +746,10 @@ mod tests {
KeyWithModifier::new(BareKey::Char('x')),
vec![Action::CloseFocus, TO_NORMAL],
),
(
KeyWithModifier::new(BareKey::Char('m')),
vec![Action::CloseUnfocused, TO_NORMAL],
),
(
KeyWithModifier::new(BareKey::Char('f')),
vec![Action::ToggleFocusFullscreen, TO_NORMAL],
Expand Down
1 change: 1 addition & 0 deletions example/alt-centered-config.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ keybinds {
bind "p" { SwitchFocus; }
bind "n" { NewPane; }
bind "x" { CloseFocus; }
bind "o" { CloseUnfocused; }
bind "f" { ToggleFocusFullscreen; }
bind "z" { TogglePaneFrames; }
}
Expand Down
2 changes: 2 additions & 0 deletions example/config.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ keybinds {
bind "d" { NewPane "Down"; SwitchToMode "Normal"; }
bind "r" { NewPane "Right"; SwitchToMode "Normal"; }
bind "x" { CloseFocus; SwitchToMode "Normal"; }
bind "o" { CloseUnfocused; SwitchToMode "Normal"; }
bind "f" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
bind "z" { TogglePaneFrames; SwitchToMode "Normal"; }
bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; }
Expand Down Expand Up @@ -127,6 +128,7 @@ keybinds {
bind "o" { FocusNextPane; }
bind "d" { Detach; }
bind "x" { CloseFocus; SwitchToMode "Normal"; }
bind "o" { CloseUnfocused; SwitchToMode "Normal"; }
}
shared_except "locked" {
bind "Ctrl g" { SwitchToMode "Locked"; }
Expand Down
2 changes: 2 additions & 0 deletions example/default.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ keybinds {
bind "d" { NewPane "Down"; SwitchToMode "Normal"; }
bind "r" { NewPane "Right"; SwitchToMode "Normal"; }
bind "x" { CloseFocus; SwitchToMode "Normal"; }
bind "o" { CloseUnfocused; SwitchToMode "Normal"; }
bind "f" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
bind "z" { TogglePaneFrames; SwitchToMode "Normal"; }
bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; }
Expand Down Expand Up @@ -172,6 +173,7 @@ keybinds {
bind "d" { Detach; }
bind "Space" { NextSwapLayout; }
bind "x" { CloseFocus; SwitchToMode "Normal"; }
bind "o" { CloseUnfocused; SwitchToMode "Normal"; }
}
shared_except "locked" {
bind "Ctrl g" { SwitchToMode "Locked"; }
Expand Down
4 changes: 4 additions & 0 deletions example/screen-overview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ keybinds:
# key: [Char: 'x', Ctrl: 'x',]
- action: [CloseFocus, SwitchToMode: Normal,]
key: [Char: 'X',]
- action: [CloseUnfocused, SwitchToMode: Normal,]
key: [Char: 'm',]
#- action: [LockTerminal, SwitchToMode: Normal,]
# key: [Char: 'x', Ctrl: 'x',]
#- action: [SuspendZellij, SwitchToMode: Normal,]
Expand Down Expand Up @@ -235,6 +237,8 @@ keybinds:
key: [Char: 'r',]
- action: [CloseFocus,]
key: [Char: 'x',]
- action: [CloseUnfocused,]
key: [Char: 'm',]
- action: [ToggleFocusFullscreen,]
key: [Char: 'f',]
- action: [FocusPreviousPane,]
Expand Down
Loading