Skip to content

Commit

Permalink
key bindings for linux and windows
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Oct 14, 2024
1 parent 795e79f commit 6e36030
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 14 deletions.
12 changes: 10 additions & 2 deletions docs/docs/default-key-bindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ language: 'en'
| Select the last tab | `Control + Shift + 9` |
| Search forward | `Control + Shift + f` |
| Search backward | `Control + Shift + b` |
| Split right | `Control + Shift + r` |
| Split down | `Control + Shift + d` |
| Select next split | `Control + Shift + ]` |
| Select prev split | `Control + Shift + [` |

### Linux and BSD

Expand All @@ -92,8 +96,12 @@ language: 'en'
| Select the seventh tab | `Control + Shift + 7` |
| Select the eighth tab | `Control + Shift + 8` |
| Select the last tab | `Control + Shift + 9` |
| Search forward | `Control + Shift + f` |
| Search backward | `Control + Shift + b` |
| Search forward | `Control + Shift + f` |
| Search backward | `Control + Shift + b` |
| Split right | `Control + Shift + r` |
| Split down | `Control + Shift + d` |
| Select next split | `Control + Shift + ]` |
| Select prev split | `Control + Shift + [` |

### Search

Expand Down
44 changes: 32 additions & 12 deletions frontends/rioterm/src/bindings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1103,10 +1103,10 @@ pub fn platform_key_bindings(
if use_splits {
key_bindings.extend(bindings!(
KeyBinding;
"d", ModifiersState::SUPER; Action::SplitRight;
"d", ModifiersState::SUPER | ModifiersState::SHIFT; Action::SplitDown;
"]", ModifiersState::SUPER; Action::SelectNextSplit;
"[", ModifiersState::SUPER; Action::SelectPrevSplit;
"d", ModifiersState::SUPER, ~BindingMode::SEARCH, ~BindingMode::VI; Action::SplitRight;
"d", ModifiersState::SUPER | ModifiersState::SHIFT, ~BindingMode::SEARCH, ~BindingMode::VI; Action::SplitDown;
"]", ModifiersState::SUPER, ~BindingMode::SEARCH, ~BindingMode::VI; Action::SelectNextSplit;
"[", ModifiersState::SUPER, ~BindingMode::SEARCH, ~BindingMode::VI; Action::SelectPrevSplit;
));
}

Expand All @@ -1122,16 +1122,16 @@ pub fn platform_key_bindings(
) -> Vec<KeyBinding> {
let mut key_bindings = bindings!(
KeyBinding;
"v", ModifiersState::CONTROL | ModifiersState::SHIFT, ~BindingMode::VI; Action::Paste;
"c", ModifiersState::CONTROL | ModifiersState::SHIFT; Action::Copy;
"c", ModifiersState::CONTROL | ModifiersState::SHIFT,
"v", ModifiersState::CONTROL | ModifiersState::SHIFT, ~BindingMode::VI; Action::Paste;
"c", ModifiersState::CONTROL | ModifiersState::SHIFT; Action::Copy;
"c", ModifiersState::CONTROL | ModifiersState::SHIFT,
+BindingMode::VI; Action::ClearSelection;
Key::Named(Insert), ModifiersState::SHIFT, ~BindingMode::VI; Action::PasteSelection;
"0", ModifiersState::CONTROL; Action::ResetFontSize;
"=", ModifiersState::CONTROL; Action::IncreaseFontSize;
"+", ModifiersState::CONTROL; Action::IncreaseFontSize;
"+", ModifiersState::CONTROL; Action::IncreaseFontSize;
"-", ModifiersState::CONTROL; Action::DecreaseFontSize;
"0", ModifiersState::CONTROL; Action::ResetFontSize;
"=", ModifiersState::CONTROL; Action::IncreaseFontSize;
"+", ModifiersState::CONTROL; Action::IncreaseFontSize;
"+", ModifiersState::CONTROL; Action::IncreaseFontSize;
"-", ModifiersState::CONTROL; Action::DecreaseFontSize;
"-", ModifiersState::CONTROL; Action::DecreaseFontSize;
"n", ModifiersState::CONTROL | ModifiersState::SHIFT; Action::WindowCreateNew;
",", ModifiersState::CONTROL | ModifiersState::SHIFT; Action::ConfigEditor;
Expand Down Expand Up @@ -1164,6 +1164,16 @@ pub fn platform_key_bindings(
));
}

if use_splits {
key_bindings.extend(bindings!(
KeyBinding;
"r", ModifiersState::CONTROL | ModifiersState::SHIFT, ~BindingMode::SEARCH, ~BindingMode::VI; Action::SplitRight;
"d", ModifiersState::CONTROL | ModifiersState::SHIFT, ~BindingMode::SEARCH, ~BindingMode::VI; Action::SplitDown;
"]", ModifiersState::CONTROL | ModifiersState::SHIFT, ~BindingMode::SEARCH, ~BindingMode::VI; Action::SelectNextSplit;
"[", ModifiersState::CONTROL | ModifiersState::SHIFT, ~BindingMode::SEARCH, ~BindingMode::VI; Action::SelectPrevSplit;
));
}

key_bindings
}

Expand Down Expand Up @@ -1223,6 +1233,16 @@ pub fn platform_key_bindings(
));
}

if use_splits {
key_bindings.extend(bindings!(
KeyBinding;
"r", ModifiersState::CONTROL | ModifiersState::SHIFT, ~BindingMode::SEARCH, ~BindingMode::VI; Action::SplitRight;
"d", ModifiersState::CONTROL | ModifiersState::SHIFT, ~BindingMode::SEARCH, ~BindingMode::VI; Action::SplitDown;
"]", ModifiersState::CONTROL | ModifiersState::SHIFT, ~BindingMode::SEARCH, ~BindingMode::VI; Action::SelectNextSplit;
"[", ModifiersState::CONTROL | ModifiersState::SHIFT, ~BindingMode::SEARCH, ~BindingMode::VI; Action::SelectPrevSplit;
));
}

key_bindings
}

Expand Down

0 comments on commit 6e36030

Please sign in to comment.