micro-editor / plugin-channel

Official plugin channel for micro
226 stars 49 forks source link

Add jlabbrev plugin #56

Closed MasFlam closed 3 years ago

MasFlam commented 3 years ago

I created a plugin that provides all the abbreviations from the Julia prompt (which I believe were taken from LaTeX). When you for example type \euler and hit <tab>, then it gets replaced with . I didn't notice any slowdowns at micro startup as well, which is impressive, since there are 3000+ abbreviations. Every time you hit tab and the last backslash is on the same line to the left, the running complexity is basically O(n) where n is the X position of the cursor.

zyedidia commented 3 years ago

Cool! Looks good to me. You might want to consider defining your autocomplete function as an action so users can rebind it from tab. To bind it to tab, you can just place it in front of the default actions that are bound to tab. Anyway this is great already so I'll merge!

MasFlam commented 3 years ago

Yeah I'll do that since I also noticed when writing some python that when spaces are used for tabs it doesn't work

MasFlam commented 3 years ago

@zyedidia By an action, do you mean a command? I'm looking through the default plugins' code and they don't seem to mention actions at all