Make recursive global abbreviations a bit nicer? #114
Replies: 2 comments 12 replies
-
Interesting. This helps me understand your #99 and the fact that it's still a frustration for you makes me want to hack on it. This reaches me at almost a great time: just wrapped up a side project. But in fact it reaches me at a bad time, because with that side project wrapped I'm determined to not let development side projects eat up discretionary time for a while.
If you or someone else wants to take a stab… Maybe we could have an array of I think the change will be in For command abbreviations (now misnamed but oh well!) we'll need to see if the LBUFFER is in the prefix array. For global abbreviations we'll need to see if the LBUFFER ends in something in the prefix array. 👀 Might be able to modify what's currently the If that doesn't pan out, the regex- |
Beta Was this translation helpful? Give feedback.
-
Just to see if I understand this feature correctly. It seems most useful for nested abbreviations. Like |
Beta Was this translation helpful? Give feedback.
-
I've got something kinda neat going, but it needs just a little bit extra to really be great.
I have the following abbreviations defined.
So on a fresh command line, I can type
a i
which expands first toapt i
thenapt install
. I can also types a
which expands first tosudo @a
thensudo apt
. However, I can't types a i
to getsudo apt install
, because by the time we've expanded tosudo apt
, there's no longer an "@" anywhere in the line, and so the@apt i
abbreviation can't match it.I can work around this in a naive way, by exhaustively creating abbreviations for every combination of
apt
parameters andsudo
; but I am wondering if there's a way to get what I want without going down that road. (I could also just defineapt i
as a global abbreviation, but I really want to avoid "automatic" global abbreviations messing with me just trying to type normal things (hence my custom of prefixing global abbreviations with "@").)Beta Was this translation helpful? Give feedback.
All reactions