Add support to change 🎹 key bindings
As a user of zellij and lazyjj I want to be able to save the message using the describe popup which being ctrl-s conflicts with zellij (ctrl-s is search).
- Start lazyjj
- On a change in the log panel hit
dfor describe - Add some text
- Use Ctrl-s to save it
Expected: The dialog is dismissed and the description for the change has been made. Actual: Zellij switches to search mode and it is not possible to save the change's description from lazyjj.
If I could change the key binding to something else in a config dot file this would fix my issue as I'd rather not have to make the key binding change in zellij.
- [x] Log tab https://github.com/Cretezy/lazyjj/pull/94
- [ ] Files tab https://github.com/Cretezy/lazyjj/pull/137
- [ ] Bookmarks tab
- [ ] Command log tab
- [ ] Details pane
I'm open to custom keybindings in the repo. I'll look into adding this. I'm open to PRs as well
Partially done in #94 (for log tab). Other tabs can be added in the future
Would be great if we could have this also for the details pane.
Right now I use a crude local patch for key inputs:
diff --git a/src/ui/details_panel.rs b/src/ui/details_panel.rs
index d6082e8..1455bf2 100644
--- a/src/ui/details_panel.rs
+++ b/src/ui/details_panel.rs
@@ -50,6 +50,17 @@ impl DetailsPanel {
/// Handle input. Returns bool of if event was handled
pub fn input(&mut self, key: KeyEvent) -> bool {
match key.code {
+ KeyCode::Char(' ')
+ if key.modifiers.contains(KeyModifiers::CONTROL)
+ && key.modifiers.contains(KeyModifiers::SHIFT) =>
+ {
+ self.scroll((self.height as isize / 2).saturating_neg())
+ }
+ KeyCode::Char(' ') if key.modifiers.contains(KeyModifiers::CONTROL) => {
+ self.scroll(self.height as isize / 2)
+ }
+ KeyCode::Char(' ') if key.modifiers.contains(KeyModifiers::SHIFT) => self.scroll(-1),
+ KeyCode::Char(' ') => self.scroll(1),
KeyCode::Char('e') if key.modifiers.contains(KeyModifiers::CONTROL) => self.scroll(1),
KeyCode::Char('y') if key.modifiers.contains(KeyModifiers::CONTROL) => self.scroll(-1),
KeyCode::Char('d') if key.modifiers.contains(KeyModifiers::CONTROL) => {