-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add keybinds for toggling common settings #3309
Add keybinds for toggling common settings #3309
Conversation
Cool! 👍 BTW I restored my config with a simple (a lisp for configuration would be awesome) |
The toggle should disable the feature if it's enabled in any way and should enable the feature to the hard-coded default if it's disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool! I don't know if it's OK for me to do the review, but here I am anyway :)
@the-mikedavis Please can we toggle the line numbers on and off? I see this as much more important than line number relative toggles. A perfect solution would be to cycle through all three states with If you are writing docs in markdown you never need line numbers, and even when coding I personally only use line numbers when some legacy linter only gives line numbers of errors, rather than an LSP that can take you right to the problem. |
PS: relative line numbers will make |
I think it would feel cool and easier to use than |
After thinking about it more, I think you're right. Probably cool and natural. I'll edit my comment with a strike through. |
I don't have any qualms about this command cycling between a list of options. IMO, if it were configurable then the options would be a list. If visible whitespace had the Selection variant implemented #2208, the toggle would include that. Similar with #3242. Implementation-wise it's not very clean to disable/enable the line-number gutter because it's controlled by the gutters configuration and not |
Despite this working as a proof-of-concept I think it would be better to be able to accomplish this with custom keybinds once there is scripting support / better config. In the meantime people can use this PR as a guide if they want to build something similar locally |
hx.mp4
This adds a
<space>t
binding that can toggle a few select settings:It's has limitations:
:set
Closes #2849
Footnotes
IMO this should wait for a more general purpose config language. It's possible to do it in TOML but it wouldn't be particularly elegant. It could be pretty elegant to do it if keymaps were written in something like lisp :P ↩