-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
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) -Osince 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 ) -OGranted, there could be consequences of supporting additional expansion triggers that I haven't thought of.