mrjackwills / oxker

A simple tui to view & control docker containers
MIT License
634 stars 22 forks source link

[NEW FEATURE] Custom keybindings #47

Open AlisCode opened 3 weeks ago

AlisCode commented 3 weeks ago

First of all: Hi, great work on this tool! I'd like to start using it by integrating it into my neovim config. This is an awesome effort, thanks for the hard work.

Is your feature request related to a problem? Please describe. I'm a bit frustrated by the lack of configuration for keybindings. Namely :

This is just me though, and I'm sure other people would love to customize the tool how they see fit. A follow-up to this issue is probably the ability to customize the colors of the app (the white text on pink background on the help panel in my terminal is .. very hard to read)

Describe the solution you'd like Ideally the user would be able to have a keybindings file stored wherever deemed relevant (e.g. $HOME/.config/oxker/keybindings.ron).

Implementation-wise :

Regarding the format of the config file, there's a metric ton of alternatives, including :

I really like gitui's documentation and technical choice (RON), but I fully acknowledge that it might not be the most welcoming choice, especially for non-Rust folks. Nothing more frustrating than learning about a new tool and seeing a config file with an extension that you've never seen before.

All in all, I think RON or TOML would be great choices. Let me know what you think.

Describe alternatives you've considered I described alternatives for config languages above. For larger customization purposes, programs such as neovim allow the user to customize everything with Lua, but this is because the customization goes waaay beyond the scope of keybindings.

Additional context Looks like input_handler/mod.rs contains the list of hardcoded keybindings. Some functions may need to be renamed, e.g. s_key, enter_key, tab_key and the likes.

mrjackwills commented 3 weeks ago

Yeah that sounds useful, I think the format of the config file could be a sticking point. I'd always edge towards JSON, for ease of use, even though the format itself always causes me pain, but that gitui documentation is interesting and informative.