danvergara / dblab

The database client every command line junkie deserves.
MIT License
2.4k stars 63 forks source link

feat: enable vim inspired navigation to jump around views (0,$,G,g) #191

Closed adasauce closed 8 months ago

adasauce commented 8 months ago

Description

I've been using dblab for a while, and every time I open it to explore tables and results i get a little frustrated with scrolling, so for myself I implemented some new key binds:

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Tested by navigating around views with no data yet, partial data, and overflowing data. Cursor stays within bounds

Checklist:

Let me know if this requires any further testing or the style guidelines don't match up.


Also let me know if it's not needed or desired, sort of a drive-by pull request because I needed the feature and thought others might as well.

danvergara commented 8 months ago

This so nice!!!

It's night in my time, but I'll review first thing, tomorrow morning. It looks great at a first glance, tho.

Thanks so much!

danvergara commented 8 months ago

Thanks @adasauce!!

As a long time vim user, I can say that I loved this contribution. It's really useful to go back and forth in very wide tables. Just one thing before approving. Can you add the new key bindings description to the README.md file?

adasauce commented 8 months ago

@danvergara updated the REAMDE (hopefully) matching the existing style.

adasauce commented 8 months ago

@danvergara thanks for merging <3

I'm glad I stumbled across vim people, I'm sure there are folks who would look at these binds as crazy and make no sense

danvergara commented 8 months ago

Even tho @Arturomtz8 is not a vim user, he liked the key bindings so much, so I think it makes sense to not only vim people.

I'm planning out a complete re-write on the UI aspect to replace the current UI library in favor of bubbletea. So, I'm gonna keep those key bindings that you added @adasauce, tho.

adasauce commented 8 months ago

oh fun, I've always wanted to try bubbletea. Look forward to seeing how you leverage it here, I'll try to keep an eye out to see if there's anything I can do to help down the road.

Cheers!