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

Add a mappable version of existing :reflow command #7098

Closed
wants to merge 1 commit into from

Conversation

jw013
Copy link
Contributor

@jw013 jw013 commented May 21, 2023

#2128 added the reflow command but I found I was not able to bind any keys to it because it was only added in the command (:) mode. This change adds a mappable command to call the existing reflow function. When used as a keymap, the count is used as the text width, with a missing or zero count triggering the existing original fallback default logic. This change does not set a default keybinding for the new reflow command to leave that decision up for discussion. I use Alt-q myself.

@robinvd
Copy link
Contributor

robinvd commented May 22, 2023

you should be able to bind it using this syntax

[keys.normal]
q = ":reflow"

@jw013
Copy link
Contributor Author

jw013 commented May 22, 2023

Thanks, not sure how I missed that. There is one benefit of a dedicated normal mode command which is that a text-width argument can be specified using the count. So e.g. 99q would run the equivalent of :reflow 99 and 80q would do :reflow 80, etc.

@kirawi kirawi added A-helix-term Area: Helix term improvements S-needs-discussion Status: Needs discussion or design. and removed S-needs-discussion Status: Needs discussion or design. labels May 24, 2023
@the-mikedavis
Copy link
Member

With #6979 and some extra work we could add a %val{count} expansion that would cover that use-case. I don't want to have to add non-typable versions of any typable commands to work around functionality issues with keybinding

@jw013 jw013 closed this Jun 13, 2023
@jw013 jw013 deleted the add_mappable_command_reflow branch June 13, 2023 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants