TeXiFy-IDEA
TeXiFy-IDEA copied to clipboard
User extensible postfixes
I was wondering whether it would be possible to make the postfixes that come with the plugin extensible by the user. I wanted to add some more postfixes, but was not able to, even though I can see the LaTeX postfixes in the list (see screenshot below).
Is there a way to achieve this already that I haven't seen?
Thanks for the suggestion! No, I don't think it is possible at the moment, but it looks like it should be possible to provide adding/editing of postfix templates using live templates syntax.
That would be really nice! I would really enjoy to add my own postfixes which represent the options / commands that I am using the most.
If you are willing to install another plugin, the https://plugins.jetbrains.com/plugin/9862-custom-postfix-templates plugin has an integration with Texify-IDEA (its only mentioned with one sentence at https://hannah-sten.github.io/TeXiFy-IDEA/code-completion.html#postfix-code-completion). Here is an example of a template I use
.proper : latex propername
TEXT → \propername{$expr$}$END$
Oh yes, I completely forgot you added LaTeX support to that plugin! Maybe I should have read my own documentation :)
Thank you! I actually tried to use this plugin before opening this issue but was not successful 😅 I tried it again with the example by @fberlakovich above, but still have the issue that the plugin does not load the file contents correctly (aka doesn't load anything). Do you have any suggestions what I might want to change for this to work?
This is the content of my file:
.proper : latex propername
TEXT → \propername{$expr$}$END$
How did you create the template file? For me, the plugin behaved weirdly when I tried to add a template via the Shift+Alt+P shortcut (it would sometimes show an error message that postfix templates are not supported for text or something). In the end I added a new template file directly in the settings dialog in your screenshot. For reference, this is how it looks like on my machine
Also seems like other people have a similar issue: https://github.com/xylo/intellij-postfix-templates/issues/220, but at least there seems to be a workaround
Thanks for pointing me to that repo (could've thought of this myself). I found a workaround and now it works for me as well, thanks again!
@anneborcherding @PHPirates I guess we can close this issue?
We could, though I think it might still be a good idea to implement a very simple default editor (https://plugins.jetbrains.com/docs/intellij/advanced-postfix-templates.html#editable-postfix-templates)
So for my concrete use case, I found a solution, but I agree with @PHPirates that an editor would be a great enhancement!
We could, though I think it might still be a good idea to implement a very simple default editor (https://plugins.jetbrains.com/docs/intellij/advanced-postfix-templates.html#editable-postfix-templates)
You mean in addition to the one the custom postfix template plugin already provides? Iirc it has an editor, there just seems to be a bug that it doesn't always open when it should.