Rosettea / Hilbish

🌓 The Moon-powered shell! A comfy and extensible shell for Lua fans! 🌺 ✨
https://rosettea.github.io/Hilbish/
MIT License
489 stars 20 forks source link

feat: abbreviations #299

Open TorchedSammy opened 2 months ago

TorchedSammy commented 2 months ago

abbreviations are an alternative to aliases which are (short) words that are expanded when entered. this can be done on the space key or enter key (user selectable).

example: if a user sets an abbreviation gp to be git push, when typing gp and then the space and/or enter key, it will expand to git push. this means the expanded form will be saved to history instead

perospirone commented 2 months ago

I'm going to do this, do you have any recommendations? I haven't looked at the project code in a while

TorchedSammy commented 2 months ago

look at line 848 (seqAltDelete) which deletes a word. then you can just insert the expanded version. of course you have to check if the last word is a valid abbreviation.

perospirone commented 2 months ago

ok, tomorrow I'll start doing that!