feat(keybinds): improve default keybindings (#991)

This commit is contained in:
Aram Drevekenin 2022-01-04 17:24:18 +01:00 committed by GitHub
parent 0d0064afff
commit d4b14d7657
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 115 additions and 88 deletions

View file

@ -120,7 +120,6 @@ pub fn split_terminals_vertically() {
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&SPLIT_RIGHT_IN_PANE_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -164,7 +163,6 @@ pub fn cannot_split_terminals_vertically_when_active_terminal_is_too_small() {
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&SPLIT_RIGHT_IN_PANE_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -213,8 +211,6 @@ pub fn scrolling_inside_a_pane() {
{
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&SPLIT_RIGHT_IN_PANE_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -312,8 +308,6 @@ pub fn toggle_pane_fullscreen() {
{
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&SPLIT_RIGHT_IN_PANE_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -327,8 +321,6 @@ pub fn toggle_pane_fullscreen() {
// cursor is in the newly opened second pane
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&TOGGLE_ACTIVE_TERMINAL_FULLSCREEN_IN_PANE_MODE);
// back to normal mode after toggling fullscreen
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -376,8 +368,6 @@ pub fn open_new_tab() {
{
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&SPLIT_RIGHT_IN_PANE_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -391,8 +381,6 @@ pub fn open_new_tab() {
// cursor is in the newly opened second pane
remote_terminal.send_key(&TAB_MODE);
remote_terminal.send_key(&NEW_TAB_IN_TAB_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -444,8 +432,6 @@ pub fn close_tab() {
{
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&SPLIT_RIGHT_IN_PANE_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -459,8 +445,6 @@ pub fn close_tab() {
// cursor is in the newly opened second pane
remote_terminal.send_key(&TAB_MODE);
remote_terminal.send_key(&NEW_TAB_IN_TAB_MODE);
// back to normal mode
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -527,8 +511,6 @@ pub fn close_pane() {
{
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&SPLIT_RIGHT_IN_PANE_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -542,8 +524,6 @@ pub fn close_pane() {
// cursor is in the newly opened second pane
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&CLOSE_PANE_IN_PANE_MODE);
// back to normal mode after close
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -672,8 +652,6 @@ pub fn typing_exit_closes_pane() {
{
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&SPLIT_RIGHT_IN_PANE_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -737,8 +715,6 @@ pub fn resize_pane() {
{
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&SPLIT_RIGHT_IN_PANE_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -752,7 +728,7 @@ pub fn resize_pane() {
// cursor is in the newly opened second pane
remote_terminal.send_key(&RESIZE_MODE);
remote_terminal.send_key(&RESIZE_LEFT_IN_RESIZE_MODE);
// back to normal mode after resizing
// back to normal mode
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
@ -861,8 +837,6 @@ pub fn resize_terminal_window() {
{
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&SPLIT_RIGHT_IN_PANE_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -922,8 +896,6 @@ pub fn detach_and_attach_session() {
{
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&SPLIT_RIGHT_IN_PANE_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -1044,8 +1016,6 @@ fn focus_pane_with_mouse() {
{
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&SPLIT_RIGHT_IN_PANE_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -1105,8 +1075,6 @@ pub fn scrolling_inside_a_pane_with_mouse() {
{
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&SPLIT_RIGHT_IN_PANE_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -1198,8 +1166,6 @@ pub fn start_without_pane_frames() {
{
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&SPLIT_RIGHT_IN_PANE_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -1268,8 +1234,6 @@ pub fn mirrored_sessions() {
{
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&SPLIT_RIGHT_IN_PANE_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -1283,8 +1247,6 @@ pub fn mirrored_sessions() {
// cursor is in the newly opened second pane
remote_terminal.send_key(&TAB_MODE);
remote_terminal.send_key(&NEW_TAB_IN_TAB_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -1505,8 +1467,6 @@ pub fn multiple_users_in_different_panes_and_same_tab() {
{
remote_terminal.send_key(&PANE_MODE);
remote_terminal.send_key(&SPLIT_RIGHT_IN_PANE_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete
@ -1596,8 +1556,6 @@ pub fn multiple_users_in_different_tabs() {
// cursor is in the newly opened second pane
remote_terminal.send_key(&TAB_MODE);
remote_terminal.send_key(&NEW_TAB_IN_TAB_MODE);
// back to normal mode after split
remote_terminal.send_key(&ENTER);
step_is_complete = true;
}
step_is_complete

View file

@ -26,4 +26,4 @@ expression: last_snapshot
│ ││ │
└──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘
Ctrl + <g> LOCK  <p> PANE  <t> TAB  <n> RESIZE  <h> MOVE  <s> SCROLL  <o> SESSION  <q> QUIT 
<←↓↑→> Move focus / <n> New / <x> Close / <r> Rename / <s> Sync / <Tab> Toggle / <ENTER> Select pane
Tip: Alt + <n> => new pane. Alt + <[] or hjkl> => navigate. Alt + <+-> => resize pane.

View file

@ -55,7 +55,7 @@ keybinds:
- action: [SwitchToMode: Tab,]
key: [Ctrl: 't',]
- action: [SwitchToMode: Normal,]
key: [Ctrl: 'r', Char: "\n", Char: ' ', Esc]
key: [Ctrl: 'n', Char: "\n", Char: ' ', Esc]
- action: [SwitchToMode: Scroll,]
key: [Ctrl: 's']
- action: [SwitchToMode: Session,]
@ -75,7 +75,7 @@ keybinds:
- action: [Resize: Increase,]
key: [Char: '=']
- action: [Resize: Increase,]
key: [ Alt: '+']
key: [ Char: '+']
- action: [Resize: Decrease,]
key: [Char: '-']
- action: [NewPane: ,]
@ -92,6 +92,12 @@ keybinds:
key: [ Alt: '[',]
- action: [FocusNextPane,]
key: [ Alt: ']',]
- action: [Resize: Increase,]
key: [ Alt: '=']
- action: [Resize: Increase,]
key: [ Alt: '+']
- action: [Resize: Decrease,]
key: [ Alt: '-']
pane:
- action: [SwitchToMode: Locked,]
key: [Ctrl: 'g']
@ -119,22 +125,38 @@ keybinds:
key: [ Char: 'k', Up,]
- action: [SwitchFocus,]
key: [Char: 'p']
- action: [NewPane: ,]
key: [Char: 'n', Alt: 'n',]
- action: [NewPane: Down,]
- action: [NewPane: , SwitchToMode: Normal,]
key: [Char: 'n',]
- action: [NewPane: Down, SwitchToMode: Normal,]
key: [Char: 'd',]
- action: [NewPane: Right,]
- action: [NewPane: Right, SwitchToMode: Normal,]
key: [Char: 'r',]
- action: [CloseFocus,]
- action: [CloseFocus, SwitchToMode: Normal,]
key: [Char: 'x',]
- action: [ToggleFocusFullscreen,]
- action: [ToggleFocusFullscreen, SwitchToMode: Normal,]
key: [Char: 'f',]
- action: [TogglePaneFrames,]
- action: [TogglePaneFrames, SwitchToMode: Normal,]
key: [Char: 'z',]
- 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: '-']
- action: [SwitchToMode: RenamePane, PaneNameInput: [0],]
key: [Char: 'c']
move:
@ -178,6 +200,12 @@ keybinds:
key: [ Alt: '[',]
- action: [FocusNextPane,]
key: [ Alt: ']',]
- action: [Resize: Increase,]
key: [ Alt: '=']
- action: [Resize: Increase,]
key: [ Alt: '+']
- action: [Resize: Decrease,]
key: [ Alt: '-']
tab:
- action: [SwitchToMode: Locked,]
key: [Ctrl: 'g']
@ -197,20 +225,38 @@ keybinds:
key: [Char: 'r']
- action: [Quit,]
key: [Ctrl: 'q',]
- action: [FocusPreviousPane,]
key: [ Alt: '[',]
- action: [FocusNextPane,]
key: [ Alt: ']',]
- action: [GoToPreviousTab,]
key: [ Char: 'h', Left, Up, Char: 'k',]
- action: [GoToNextTab,]
key: [ Char: 'l', Right,Down, Char: 'j']
- action: [NewTab: ,]
- action: [NewTab: , SwitchToMode: Normal,]
key: [ Char: 'n',]
- action: [CloseTab,]
- action: [CloseTab, SwitchToMode: Normal,]
key: [ Char: 'x',]
- action: [ToggleActiveSyncTab]
- action: [ToggleActiveSyncTab, SwitchToMode: Normal,]
key: [Char: 's']
- action: [GoToTab: 1, SwitchToMode: Normal,]
key: [ Char: '1',]
- action: [GoToTab: 2, SwitchToMode: Normal,]
key: [ Char: '2',]
- action: [GoToTab: 3, SwitchToMode: Normal,]
key: [ Char: '3',]
- action: [GoToTab: 4, SwitchToMode: Normal,]
key: [ Char: '4',]
- action: [GoToTab: 5, SwitchToMode: Normal,]
key: [ Char: '5',]
- action: [GoToTab: 6, SwitchToMode: Normal,]
key: [ Char: '6',]
- action: [GoToTab: 7, SwitchToMode: Normal,]
key: [ Char: '7',]
- action: [GoToTab: 8, SwitchToMode: Normal,]
key: [ Char: '8',]
- action: [GoToTab: 9, SwitchToMode: Normal,]
key: [ Char: '9',]
- action: [ToggleTab]
key: [ Char: "\t" ]
- action: [NewPane: ,]
key: [ Alt: 'n',]
- action: [MoveFocus: Left,]
key: [ Alt: 'h',]
- action: [MoveFocus: Right,]
@ -219,30 +265,19 @@ keybinds:
key: [ Alt: 'j',]
- action: [MoveFocus: Up,]
key: [ Alt: 'k',]
- action: [GoToTab: 1,]
key: [ Char: '1',]
- action: [GoToTab: 2,]
key: [ Char: '2',]
- action: [GoToTab: 3,]
key: [ Char: '3',]
- action: [GoToTab: 4,]
key: [ Char: '4',]
- action: [GoToTab: 5,]
key: [ Char: '5',]
- action: [GoToTab: 6,]
key: [ Char: '6',]
- action: [GoToTab: 7,]
key: [ Char: '7',]
- action: [GoToTab: 8,]
key: [ Char: '8',]
- action: [GoToTab: 9,]
key: [ Char: '9',]
- action: [ToggleTab]
key: [ Char: "\t" ]
- action: [FocusPreviousPane,]
key: [ Alt: '[',]
- action: [FocusNextPane,]
key: [ Alt: ']',]
- action: [Resize: Increase,]
key: [ Alt: '=']
- action: [Resize: Increase,]
key: [ Alt: '+']
- action: [Resize: Decrease,]
key: [ Alt: '-']
scroll:
- action: [SwitchToMode: Normal,]
key: [Ctrl: 'r', Ctrl: 's', Char: ' ',
Char: "\n", Esc]
key: [Ctrl: 's', Char: ' ', Char: "\n", Esc]
- action: [SwitchToMode: Tab,]
key: [Ctrl: 't',]
- action: [SwitchToMode: Locked,]
@ -285,11 +320,15 @@ keybinds:
key: [ Alt: '[',]
- action: [FocusNextPane,]
key: [ Alt: ']',]
- action: [Resize: Increase,]
key: [ Alt: '=']
- action: [Resize: Increase,]
key: [ Alt: '+']
- action: [Resize: Decrease,]
key: [ Alt: '-']
renametab:
- action: [SwitchToMode: Normal,]
key: [Ctrl: 'r', Ctrl: 's', Char: ' ',]
- action: [SwitchToMode: Tab,]
key: [Char: "\n",]
key: [Char: "\n", Ctrl: 'c', Esc]
- action: [TabNameInput: [27] , SwitchToMode: Tab,]
key: [Esc,]
- action: [NewPane: ,]
@ -306,11 +345,15 @@ keybinds:
key: [ Alt: '[',]
- action: [FocusNextPane,]
key: [ Alt: ']',]
- action: [Resize: Increase,]
key: [ Alt: '=']
- action: [Resize: Increase,]
key: [ Alt: '+']
- action: [Resize: Decrease,]
key: [ Alt: '-']
renamepane:
- action: [SwitchToMode: Normal,]
key: [Ctrl: 'c', Ctrl: 's', Char: ' ',]
- action: [SwitchToMode: Pane,]
key: [Char: "\n",]
key: [Char: "\n", Ctrl: 'c', Esc]
- action: [PaneNameInput: [27] , SwitchToMode: Pane,]
key: [Esc,]
- action: [NewPane: ,]
@ -327,6 +370,12 @@ keybinds:
key: [ Alt: '[',]
- action: [FocusNextPane,]
key: [ Alt: ']',]
- action: [Resize: Increase,]
key: [ Alt: '=']
- action: [Resize: Increase,]
key: [ Alt: '+']
- action: [Resize: Decrease,]
key: [ Alt: '-']
session:
- action: [SwitchToMode: Locked,]
key: [Ctrl: 'g']
@ -346,6 +395,26 @@ keybinds:
key: [Ctrl: 'q',]
- action: [Detach,]
key: [Char: 'd',]
- 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