From ad21f81ac030d8a48fdb14dd23eba9309c373c04 Mon Sep 17 00:00:00 2001 From: Cason Adams Date: Tue, 3 Jan 2023 06:47:39 -0700 Subject: [PATCH] add tmux close pane key (#2058) * add tmux close pane key * chore: update snapshots for new keybind Co-authored-by: Jae-Heon Ji --- example/config.kdl | 1 + example/default.kdl | 1 + zellij-utils/assets/config/default.kdl | 1 + ...setup_test__default_config_with_no_cli_arguments.snap | 9 ++++++++- ...p_test__layout_env_vars_override_config_env_vars.snap | 9 ++++++++- ...tup_test__layout_plugins_override_config_plugins.snap | 9 ++++++++- ...setup_test__layout_themes_override_config_themes.snap | 9 ++++++++- ...est__layout_ui_config_overrides_config_ui_config.snap | 9 ++++++++- 8 files changed, 43 insertions(+), 5 deletions(-) diff --git a/example/config.kdl b/example/config.kdl index 9689be1bad..b54fe1724d 100644 --- a/example/config.kdl +++ b/example/config.kdl @@ -126,6 +126,7 @@ keybinds { bind "k" { MoveFocus "Up"; SwitchToMode "Normal"; } bind "o" { FocusNextPane; } bind "d" { Detach; } + bind "x" { CloseFocus; SwitchToMode "Normal"; } } shared_except "locked" { bind "Ctrl g" { SwitchToMode "Locked"; } diff --git a/example/default.kdl b/example/default.kdl index 2397f5bae2..248b4026cf 100644 --- a/example/default.kdl +++ b/example/default.kdl @@ -130,6 +130,7 @@ keybinds { bind "k" { MoveFocus "Up"; SwitchToMode "Normal"; } bind "o" { FocusNextPane; } bind "d" { Detach; } + bind "x" { CloseFocus; SwitchToMode "Normal"; } } shared_except "locked" { bind "Ctrl g" { SwitchToMode "Locked"; } diff --git a/zellij-utils/assets/config/default.kdl b/zellij-utils/assets/config/default.kdl index 2397f5bae2..248b4026cf 100644 --- a/zellij-utils/assets/config/default.kdl +++ b/zellij-utils/assets/config/default.kdl @@ -130,6 +130,7 @@ keybinds { bind "k" { MoveFocus "Up"; SwitchToMode "Normal"; } bind "o" { FocusNextPane; } bind "d" { Detach; } + bind "x" { CloseFocus; SwitchToMode "Normal"; } } shared_except "locked" { bind "Ctrl g" { SwitchToMode "Locked"; } diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments.snap index 8d946d7b1b..2ccadb3cef 100644 --- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments.snap +++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments.snap @@ -1,6 +1,5 @@ --- source: zellij-utils/src/setup.rs -assertion_line: 582 expression: "format!(\"{:#?}\", config)" --- Config { @@ -3124,6 +3123,14 @@ Config { Normal, ), ], + Char( + 'x', + ): [ + CloseFocus, + SwitchToMode( + Normal, + ), + ], Char( 'z', ): [ diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_env_vars_override_config_env_vars.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_env_vars_override_config_env_vars.snap index 97fb9f8125..6bc0fbbac6 100644 --- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_env_vars_override_config_env_vars.snap +++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_env_vars_override_config_env_vars.snap @@ -1,6 +1,5 @@ --- source: zellij-utils/src/setup.rs -assertion_line: 640 expression: "format!(\"{:#?}\", config)" --- Config { @@ -3124,6 +3123,14 @@ Config { Normal, ), ], + Char( + 'x', + ): [ + CloseFocus, + SwitchToMode( + Normal, + ), + ], Char( 'z', ): [ diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_plugins_override_config_plugins.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_plugins_override_config_plugins.snap index f106051299..d2391eddb9 100644 --- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_plugins_override_config_plugins.snap +++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_plugins_override_config_plugins.snap @@ -1,6 +1,5 @@ --- source: zellij-utils/src/setup.rs -assertion_line: 668 expression: "format!(\"{:#?}\", config)" --- Config { @@ -3124,6 +3123,14 @@ Config { Normal, ), ], + Char( + 'x', + ): [ + CloseFocus, + SwitchToMode( + Normal, + ), + ], Char( 'z', ): [ diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_themes_override_config_themes.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_themes_override_config_themes.snap index 13c499ddba..a69286fee2 100644 --- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_themes_override_config_themes.snap +++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_themes_override_config_themes.snap @@ -1,6 +1,5 @@ --- source: zellij-utils/src/setup.rs -assertion_line: 682 expression: "format!(\"{:#?}\", config)" --- Config { @@ -3124,6 +3123,14 @@ Config { Normal, ), ], + Char( + 'x', + ): [ + CloseFocus, + SwitchToMode( + Normal, + ), + ], Char( 'z', ): [ diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_ui_config_overrides_config_ui_config.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_ui_config_overrides_config_ui_config.snap index fc47de2322..dc086ff093 100644 --- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_ui_config_overrides_config_ui_config.snap +++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_ui_config_overrides_config_ui_config.snap @@ -1,6 +1,5 @@ --- source: zellij-utils/src/setup.rs -assertion_line: 654 expression: "format!(\"{:#?}\", config)" --- Config { @@ -3124,6 +3123,14 @@ Config { Normal, ), ], + Char( + 'x', + ): [ + CloseFocus, + SwitchToMode( + Normal, + ), + ], Char( 'z', ): [