everettraven/buoy

Add support for vim bindings

Opened this issue · 2 comments

Thank you for the project.
While navigating the tables, it would be really useful to add support for vim bindings.

This would require to map the following keys to:

j -> down
k -> up 
l -> right 
h -> left 

As of now, We use https://github.com/calyptia/go-bubble-table for rendering the table, and they only support arrows for navigation when moving in table view.
I have the changes locally adding vim support to the upstream library, but I'm not sure if that's going to be accepted.
If not, we can implement a table and keybindings from scratch.

@kranurag7 thanks for writing up this issue! I totally agree that we should add vim keybindings. I'm not married to the use of calyptia/go-bubble-table because it does seem like a low maintenance project and was considering a couple options:

  • Creating a fork of it and build new features on top of it (would give the option of trying to contribute the changes back to the upstream project) and using the go mod replace directive to point to my fork
  • Writing a custom table implementation. I originally didn't do this because I wanted to get an mvp out the door ASAP. Now that there is an initial thing that has the general user experience I'm looking for I'm open to writing something custom to replace go-bubble-table.

If you're willing to contribute any of this, let me know! I'm happy to accept any contributions that improve the overall feel and experience of the project!

Another thought I had for a short term workaround could be to catch the vim keybindings in the table panel and remap that to an arrow key message to send to the go-bubble-table but that feels like unnecessary tech debt at this point and as much as I hacked this project together I'd like to start being a bit more picky about doing things the right way from the get go 😁