diff options
author | Sagittarius-a <sagittarius-a@users.noreply.github.com> | 2021-07-21 23:43:20 +0200 |
---|---|---|
committer | Sagittarius-a <sagittarius-a@users.noreply.github.com> | 2021-08-03 21:11:50 +0200 |
commit | 5799ea4e5d9456061455244d30da98b899f20b0d (patch) | |
tree | 6a287c092614fbcb2eda3b75a76eeecf9646a3a0 /zellij-utils | |
parent | 309f4a62bfd11bd1c311d833343625f9bc476114 (diff) |
feat(tab): add keybind to go to last tab visited
Fixes #398.
Tab key is used as default for the `GoToLastTab` action.
Diffstat (limited to 'zellij-utils')
-rw-r--r-- | zellij-utils/assets/config/default.yaml | 2 | ||||
-rw-r--r-- | zellij-utils/src/errors.rs | 1 | ||||
-rw-r--r-- | zellij-utils/src/input/actions.rs | 1 | ||||
-rw-r--r-- | zellij-utils/src/input/mod.rs | 1 |
4 files changed, 5 insertions, 0 deletions
diff --git a/zellij-utils/assets/config/default.yaml b/zellij-utils/assets/config/default.yaml index 24ee95f59..2be0911d6 100644 --- a/zellij-utils/assets/config/default.yaml +++ b/zellij-utils/assets/config/default.yaml @@ -166,6 +166,8 @@ keybinds: key: [ Char: '8',] - action: [GoToTab: 9,] key: [ Char: '9',] + - action: [GoToLastTab] + key: [ Char: "\t" ] scroll: - action: [SwitchToMode: Normal,] key: [Ctrl: 'r', Ctrl: 's', Char: ' ', diff --git a/zellij-utils/src/errors.rs b/zellij-utils/src/errors.rs index 6a053038a..e215a5004 100644 --- a/zellij-utils/src/errors.rs +++ b/zellij-utils/src/errors.rs @@ -227,6 +227,7 @@ pub enum ScreenContext { MouseRelease, MouseHold, Copy, + GoToLastTab, } /// Stack call representations corresponding to the different types of [`PtyInstruction`]s. diff --git a/zellij-utils/src/input/actions.rs b/zellij-utils/src/input/actions.rs index 431a09bf7..977c1a48a 100644 --- a/zellij-utils/src/input/actions.rs +++ b/zellij-utils/src/input/actions.rs @@ -74,6 +74,7 @@ pub enum Action { /// Close the current tab. CloseTab, GoToTab(u32), + GoToLastTab, TabNameInput(Vec<u8>), /// Run speficied command in new pane. Run(RunCommandAction), diff --git a/zellij-utils/src/input/mod.rs b/zellij-utils/src/input/mod.rs index 746d58619..8601a63ec 100644 --- a/zellij-utils/src/input/mod.rs +++ b/zellij-utils/src/input/mod.rs @@ -37,6 +37,7 @@ pub fn get_mode_info( ("x".to_string(), "Close".to_string()), ("r".to_string(), "Rename".to_string()), ("s".to_string(), "Sync".to_string()), + ("Tab".to_string(), "Last".to_string()), ], InputMode::Scroll => vec![ ("↓↑".to_string(), "Scroll".to_string()), |