You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
The text was updated successfully, but these errors were encountered:
I didn't mean \r / execute but the actual \e\r which is commandline -i \n.
I find the abbreviation logic a bit confusing, though it works really well in most cases.
Good point, I think execute should not always expand abbreviations, but only if the cursor is at the command token. I don't think that behavior would surprise anyone (if you have more tokens you likely already expanded the abbreviation with a space). This should be more discoverable thatn ctrl-space.
Edit: nevermind, we already do this.
Also if a command is valid, like rm, it is not expanded by execute.