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] Add mappable commands for formatting and saving #900

Closed
wants to merge 1 commit into from

Conversation

Nehliin
Copy link
Contributor

@Nehliin Nehliin commented Oct 24, 2021

Should be trivial to do the same to the other TypeableCommands but I'm not sure it makes sense for all of the commands. These two were the most important for me personally.

Fixes #852 (partially?)

@Omnikar
Copy link
Contributor

Omnikar commented Oct 24, 2021

I'm not sure how good of an idea it would be to only make certain typable commands mappable like this, as opposed to creating some sort of implementation that would allow the user to map a key to any typable command (and perhaps allow such a mapping to pass arguments to the command as well).

@Nehliin
Copy link
Contributor Author

Nehliin commented Oct 24, 2021

I based it on this comment in the issue: #852 (comment)

@Omnikar
Copy link
Contributor

Omnikar commented Oct 24, 2021

I based it on this comment in the issue: #852 (comment)

Oh. Well, I think I'm going to have to disagree with that comment. Adding mappable commands which just invoke the typable commands would cause a lot of duplication i.e. having to maintain a function in the cmd module, an entry in the TYPABLE_COMMANDS constant, another function outside the cmd module, and a line in the commands! invocation. And additionally, you wouldn't be able to use the typable commands to their full potential because you wouldn't be able to pass arguments to them. If there were some additional system that automatically allowed the user to, in their keymap configuration, map a key to any typable command invocation, including configuring arguments to pass to the command, I think it would be much better.

@Nehliin
Copy link
Contributor Author

Nehliin commented Nov 24, 2021

Yeah I agree I will revisit this when I have time

@Nehliin Nehliin closed this Nov 24, 2021
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.

Keymap for :format or other TypableCommands
2 participants