Today I released the first alpha version of Xemmet. Xemmet is a wrapper for a very popular toolkit called Emmet. As you may know, there’s already an Emmet for Komodo, but it uses old Emmet core and legacy API, which makes customizing it very hard.
As for me, I didn’t use a lot of Emmet functionality at all. I has been using Expand Abbreviation a lot and that’s the only feature in Xemmet for now. I’m working on Wrap with Abbreviation feature which I find useful.
Note since you are using Tab you’ll want to ensure that you aren’t breaking auto-abbreviations. Ie. handle the keystroke event if you can, but if you cannot then just let it pass.
Yeah there are some issues with auto-abbreviations and auto-completions. I’ll try to fix them but no promises for that. If I won’t able to fix them I’ll ask user to update their setting so \t won’t issue auto-completions for auto-abbreviations and auto-completions.
Now, everything works fine. I added a preference for it. There will be a UI checkbox for it, but not now
If xemmet_snippets_are_important is true, then Xemmet will check your toolbox for a snippet that called the same as the abbreviation you want to expand, and, if it will find this snippet (and it’s an abbreviation, not just a snippet), then it will expand it instead of expanding an Emmet abbreviation. This is disabled by default.
To enable it for now, open Console and run this:
require('xemmet').prefs.setBool("xemmet_snippets_are_important", true). No need to restart Komodo or Xemmet.
Note
If your Emmet abbreviation is invalid (for example ~ is invalid abbreviation), then Xemmet will check if this is a custom Xemmet snippet, if not, then just pass your string to Komodo handlers, so if there’s an abbreviation called “~” - Komodo will expand it; if yes, then it will try to expand it, but if it contains some errors, then Xemmet pass it to Komodo.
Note 2:
xemmet_snippets_are_important means that Komodo snippets has the biggest priority for Xemmet.
If this setting is enabled, Xemmet will parse your string in this order:
Check if Komodo snippet, if yes - pass to Komodo to expand it, if not - next step
Check if Xemmet snippet, if yes - expand, if an error occurred - pass it to Komodo, if not - next step
Try to expand abbreviation, if successful - insert it, if not - pass to Komodo.
If this setting is disabled, Xemmet will parse your string in this order:
Check if Xemmet snippet, if yes - expand, if an error occurred - pass it to Komodo, if not - next step
Try to expand abbreviation, if successful - insert it, if not - next step
Check if Komodo snippet, if yes - pass to Komodo to expand it, if not - do nothing.
Been using the old broken plugin and bugging people to make me a new one since I’m lazy / have no time. So will be using this from today and not have to use a workaround to expand . Expand is the only thing I have ever used, didn’t even know other things existed until I had to look into the old plugin.