Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Mar 13, 2024

Conversation

adasauce
Copy link
Contributor

@adasauce adasauce commented Mar 12, 2024

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:

  • 0: move cursor and origin all the way to the left
  • $: move cursor and origin all the way to the right
  • g: move cursor and origin all the way to the top
  • G: move cursor and origin all the way to the bottom

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

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

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

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
Copy link
Owner

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
Copy link
Owner

danvergara commented Mar 13, 2024

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
Copy link
Contributor Author

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

@danvergara danvergara merged commit 260206c into danvergara:main Mar 13, 2024
@adasauce
Copy link
Contributor Author

@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
Copy link
Owner

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
Copy link
Contributor Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants