Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feature request: Expand abbreviation when entering a closing parenthesis #6658

Copy link
Copy link

Description

@scooter-dangle
Issue body actions

I didn't find this mentioned in any of the issue titles, but it's possible it was brought up tangentially in an issue around abbr.

Generally when I use an abbreviation in a command substitution, the closing ) unambiguously indicates that the token is complete, at which point it would be convenient if the abbreviation were expanded.

For example, I have the follow abbreviation defined for listing modified files:

abbr --add gsmod 'git ls-files --modified'

If I wanted to open all the modified files, I would run

vim (gsmod)

which works as intended, since the )<CR> combination triggers the expansion to

vim (git ls-files --modified)

However, if I wanted to pass any options to vim after the substitution, the following would not expand and would cause an error when entered

vim (gsmod) -O

since I have no function or commands named gsmod.

The workaround I use is to remember to add an extra space prior to the ) in cases where I know I'll be adding more to the command, which results in

vim (git ls-files --modified ) -O

Granted, there could be consequences of supporting additional expansion triggers that I haven't thought of.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.