diff options
author | Aram Drevekenin <aram@poor.dev> | 2022-02-21 15:52:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-21 15:52:42 +0100 |
commit | a0a0a7e5c4e6fccc755fb5199f7f3b853e7b3746 (patch) | |
tree | 8e10d430d12158f14b93272e5182f11231088c36 /zellij-utils | |
parent | 8aef32863f8f21335679273c1a0b186a26482c78 (diff) |
feat(ux): tmux mode (#1073)
* work
* basic tmux move and functionality
* tmux mode ui
* rustfmt
Diffstat (limited to 'zellij-utils')
-rw-r--r-- | zellij-utils/assets/config/default.yaml | 71 | ||||
-rw-r--r-- | zellij-utils/src/input/keybinds.rs | 4 | ||||
-rw-r--r-- | zellij-utils/src/input/mod.rs | 10 |
3 files changed, 81 insertions, 4 deletions
diff --git a/zellij-utils/assets/config/default.yaml b/zellij-utils/assets/config/default.yaml index 7123e362d..ba3a89163 100644 --- a/zellij-utils/assets/config/default.yaml +++ b/zellij-utils/assets/config/default.yaml @@ -22,6 +22,8 @@ keybinds: key: [Ctrl: 'o',] - action: [SwitchToMode: Move,] key: [Ctrl: 'h',] + - action: [SwitchToMode: Tmux,] + key: [Ctrl: 'b',] - action: [Quit,] key: [Ctrl: 'q',] - action: [NewPane: ] @@ -62,6 +64,8 @@ keybinds: key: [Ctrl: 'o',] - action: [SwitchToMode: Move,] key: [Ctrl: 'h',] + - action: [SwitchToMode: Tmux,] + key: [Ctrl: 'b',] - action: [Quit] key: [Ctrl: 'q'] - action: [Resize: Left,] @@ -113,6 +117,8 @@ keybinds: key: [Ctrl: 'o',] - action: [SwitchToMode: Move,] key: [Ctrl: 'h',] + - action: [SwitchToMode: Tmux,] + key: [Ctrl: 'b',] - action: [Quit,] key: [Ctrl: 'q',] - action: [MoveFocus: Left,] @@ -223,6 +229,8 @@ keybinds: key: [Ctrl: 's'] - action: [SwitchToMode: Move,] key: [Ctrl: 'h',] + - action: [SwitchToMode: Tmux,] + key: [Ctrl: 'b',] - action: [SwitchToMode: Session,] key: [Ctrl: 'o',] - action: [SwitchToMode: RenameTab, TabNameInput: [0],] @@ -290,6 +298,8 @@ keybinds: key: [Ctrl: 'p',] - action: [SwitchToMode: Move,] key: [Ctrl: 'h',] + - action: [SwitchToMode: Tmux,] + key: [Ctrl: 'b',] - action: [SwitchToMode: Session,] key: [Ctrl: 'o',] - action: [SwitchToMode: Resize,] @@ -389,6 +399,8 @@ keybinds: key: [Ctrl: 'p',] - action: [SwitchToMode: Move,] key: [Ctrl: 'h',] + - action: [SwitchToMode: Tmux,] + key: [Ctrl: 'b',] - action: [SwitchToMode: Tab,] key: [Ctrl: 't',] - action: [SwitchToMode: Normal,] @@ -419,6 +431,65 @@ keybinds: key: [ Alt: '+'] - action: [Resize: Decrease,] key: [ Alt: '-'] + tmux: + - action: [SwitchToMode: Locked,] + key: [Ctrl: 'g'] + - action: [SwitchToMode: Resize,] + key: [Ctrl: 'n',] + - action: [SwitchToMode: Pane,] + key: [Ctrl: 'p',] + - action: [SwitchToMode: Move,] + key: [Ctrl: 'h',] + - action: [SwitchToMode: Tab,] + key: [Ctrl: 't',] + - action: [SwitchToMode: Normal,] + key: [Ctrl: 'o', Char: "\n", Char: ' ', Esc] + - action: [SwitchToMode: Scroll,] + key: [Ctrl: 's'] + - action: [Quit,] + key: [Ctrl: 'q',] + - action: [NewPane: Down, SwitchToMode: Normal,] + key: [Char: "\"",] + - action: [NewPane: Right, SwitchToMode: Normal,] + key: [Char: '%',] + - action: [ToggleFocusFullscreen, SwitchToMode: Normal,] + key: [Char: 'z',] + - action: [NewTab: , SwitchToMode: Normal,] + key: [ Char: 'c',] + - action: [SwitchToMode: RenameTab, TabNameInput: [0],] + key: [Char: ','] + - action: [GoToPreviousTab, SwitchToMode: Normal,] + key: [ Char: 'p'] + - action: [GoToNextTab, SwitchToMode: Normal,] + key: [ Char: 'n'] + - action: [MoveFocus: Left, SwitchToMode: Normal,] + key: [ Left,] + - action: [MoveFocus: Right, SwitchToMode: Normal,] + key: [ Right,] + - action: [MoveFocus: Down, SwitchToMode: Normal,] + key: [ Down,] + - action: [MoveFocus: Up, SwitchToMode: Normal,] + key: [ Up,] + - action: [NewPane: ,] + key: [ Alt: 'n',] + - action: [MoveFocus: Left,] + key: [ Alt: 'h',] + - action: [MoveFocus: Right,] + key: [ Alt: 'l',] + - action: [MoveFocus: Down,] + key: [ Alt: 'j',] + - action: [MoveFocus: Up,] + key: [ Alt: 'k',] + - action: [FocusPreviousPane,] + key: [ Alt: '[',] + - action: [FocusNextPane,] + key: [ Alt: ']',] + - action: [Resize: Increase,] + key: [ Alt: '='] + - action: [Resize: Increase,] + key: [ Alt: '+'] + - action: [Resize: Decrease,] + key: [ Alt: '-'] plugins: - path: tab-bar tag: tab-bar diff --git a/zellij-utils/src/input/keybinds.rs b/zellij-utils/src/input/keybinds.rs index 5e8ba033e..4838fdf64 100644 --- a/zellij-utils/src/input/keybinds.rs +++ b/zellij-utils/src/input/keybinds.rs @@ -199,10 +199,6 @@ impl Keybinds { .0 .get(mode) .unwrap_or({ - log::warn!( - "The following mode has no action associated with it: {:?}", - mode - ); // create a dummy mode to recover from &ModeKeybinds::new() }) diff --git a/zellij-utils/src/input/mod.rs b/zellij-utils/src/input/mod.rs index f8626e04a..391fea7b4 100644 --- a/zellij-utils/src/input/mod.rs +++ b/zellij-utils/src/input/mod.rs @@ -60,6 +60,16 @@ pub fn get_mode_info( InputMode::RenameTab => vec![("Enter".to_string(), "when done".to_string())], InputMode::RenamePane => vec![("Enter".to_string(), "when done".to_string())], InputMode::Session => vec![("d".to_string(), "Detach".to_string())], + InputMode::Tmux => vec![ + ("←↓↑→".to_string(), "Move focus".to_string()), + ("\"".to_string(), "Split Down".to_string()), + ("%".to_string(), "Split Right".to_string()), + ("z".to_string(), "Fullscreen".to_string()), + ("c".to_string(), "New Tab".to_string()), + (",".to_string(), "Rename Tab".to_string()), + ("p".to_string(), "Previous Tab".to_string()), + ("n".to_string(), "Next Tab".to_string()), + ], }; let session_name = envs::get_session_name().ok(); |