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

[FEATURE] Rename user commands in the form :Session* #175

Closed
steliyan opened this issue Sep 27, 2022 · 3 comments
Closed

[FEATURE] Rename user commands in the form :Session* #175

steliyan opened this issue Sep 27, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@steliyan
Copy link

steliyan commented Sep 27, 2022

Is your feature request related to a problem? Please describe.
It's a bit difficult to issue a plugin auto command, e.g. SaveSession, RestoreSession.

Describe the solution you'd like

Describe alternatives you've considered
I wanted to try to do it myself, by that I mean to be able to manually rename the plugin's user commands. Haven't found a way, if there is, it would be great. :)
:delcommand is a possibility, but then I need to copy/paste the plugin definitions. Not ideal, but a possibility.

Additional context
Generally speaking, it's good to have the command in the form of <PluginName><Action> as this helps discoverability as well. Personally, I don't have the habit of reading the docs.

EDIT: Kinda the same proposal for Vundle.

@steliyan steliyan added the enhancement New feature or request label Sep 27, 2022
@rmagatti
Copy link
Owner

Hey, I wouldn't mind renaming these, as long as for a while the other commands just show up as deprecated so as to not immediately just break for people.

@WhoIsSethDaniel
Copy link
Contributor

@steliyan have you considered using :cabbrev?
e.g.

:cabbrev SaveSession SessionSave
:cabbrev RestoreSession SessionRestore
...

It may be able to tide you over until this happens.

@steliyan
Copy link
Author

steliyan commented Sep 28, 2022

@rmagatti, yep, sounds reasonable. :)

@WhoIsSethDaniel, awesome, didn't know this existed. Doesn't work with https://github.com/hrsh7th/cmp-cmdline out of the box, tho (no autocomplete for the SessionSave command).

Using this:

vim.cmd([[
  cabbrev <expr> SessionSave getcmdtype() == ":" && getcmdline() == "SessionSave" ? "SaveSession" : "SessionSave"
]])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants