-
-
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
Custom typable commands #4423
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Does the editor already support custom commands and just not typables? I was thinking it would be nice to have something like: [custom.commands]
bring_line_up = {
cmds = [ 'push_register', 'extend_line', 'delete_selection', 'move_line_up', 'paste_before', 'pop_register' ] # semicolon separates operations' names from parameters' arguments.
desc = "swap line with above"
mode = editor || prompt || both
} |
or set the mode via |
You can already map keys to lists of commands (https://docs.helix-editor.com/master/remapping.html) to create custom non-typable commands. You can also rebind the |
Could separate func name from params with |
Combining sequences of typable commands is covered by this. For example #6857 might be written as: # Note: this is not implemented.
[commands]
":wcb" = [":write", ":buffer-close"] Handling the arguments of the commands is also important for the design of this feature though. If you wanted There are nuances to this though (optional arguments, aliases, command names / docs) so maybe this issue is better handled by plugins once the plugin system exists instead. We don't want to create new programming languages in the config TOML. |
That looks so sick! Imagine if we could define all key remaps like that! We could just escape for edit: That's all to say, plugin systems can get really hairy. They're complex, and easy to break on user-side. Just save ourselves time and keep it snippety, lol. |
|
Regular commands can be rebound but typable commands (anything entered in command mode,
:
) can't be modified in any way.You might use custom typable commands to implement file operations in conjunction with #3134 for example. You might define
:mv
as:sh mv $file $1
or:rm
as:sh rm $1
. (The syntax to use for variables, or whether to use variables at all should be discussed.)Custom typable commands could also be used to create custom abbreviations for commands.
The text was updated successfully, but these errors were encountered: