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

Keymap for :format or other TypableCommands #852

Closed
Nehliin opened this issue Oct 16, 2021 · 5 comments · Fixed by #1169
Closed

Keymap for :format or other TypableCommands #852

Nehliin opened this issue Oct 16, 2021 · 5 comments · Fixed by #1169
Labels
A-keymap Area: Keymap and keybindings C-enhancement Category: Improvements

Comments

@Nehliin
Copy link
Contributor

Nehliin commented Oct 16, 2021

Describe your feature request

Unless I'm missing something it doesn't seem possible to define keyremaps for TypableCommands which would be very useful. I usually have a keybinding to format the entire buffer in neovim and use it frequently. AFAIK it's not even possible to create a keybinding for select_all + format_selections since it only seems possible to map to a single action.

@Nehliin Nehliin added the C-enhancement Category: Improvements label Oct 16, 2021
@kirawi kirawi added the A-keymap Area: Keymap and keybindings label Oct 16, 2021
@archseer
Copy link
Member

@Omnikar had a PR here for sequences: #589

Maybe rather than making TypableCommands mappable, we should extract the functional bodies so they can be accessible as a Command as well.

@Nehliin
Copy link
Contributor Author

Nehliin commented Oct 17, 2021

Yeah my plan was to just make an equivalent command for the TypableCommand and reuse the same underlying functions handling the logic.

@Nehliin
Copy link
Contributor Author

Nehliin commented Nov 24, 2021

FYI didn't have time to work on helix for some time but I've started looking into this again with another approach. Should have a pr up soon.

@archseer
Copy link
Member

We were discussing about potentially allowing mappings like these: a = [":command", "arg1", "arg2"]. We can tell it apart from multi key mappings based on the : prefix on the first arg.

@Nehliin
Copy link
Contributor Author

Nehliin commented Nov 25, 2021

Yeah that's basically what I'm doing in the pr I am working on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-keymap Area: Keymap and keybindings C-enhancement Category: Improvements
Projects
None yet
3 participants