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

Document $edit:abbr #947

krader1961 opened this issue Mar 25, 2020 · 0 comments

Document $edit:abbr #947

krader1961 opened this issue Mar 25, 2020 · 0 comments


Copy link

@krader1961 krader1961 commented Mar 25, 2020

The CLI abbreviation expansion feature isn't documented. You can create abbreviations via statements such as edit:abbr['l '] = 'less ' or edit:abbr[gcp] = 'git cherry-pick -x'. Abbreviations are sometimes preferable to a function of the same name for several reasons:

  1. You might want to modify the expanded text before executing it.

  2. You want the expanded text to appear in the command history.

  3. You want a visual reminder of what will be executed by typing a cryptic shortcut like gcm.

  4. You only want the shortcut to be available at an interactive prompt, not as a function that can be used in elvish scripts, to avoid potential problems.

The existing behavior isn't optimal, IMHO, but let's start by documenting it so people are aware it exists and know how to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.