TeXiFy-IDEA icon indicating copy to clipboard operation
TeXiFy-IDEA copied to clipboard

User extensible postfixes

Open anneborcherding opened this issue 11 months ago • 12 comments

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).

grafik

Is there a way to achieve this already that I haven't seen?

anneborcherding avatar Feb 26 '24 14:02 anneborcherding

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.

PHPirates avatar Feb 26 '24 18:02 PHPirates

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.

anneborcherding avatar Feb 27 '24 15:02 anneborcherding

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$

fberlakovich avatar Feb 28 '24 13:02 fberlakovich

Oh yes, I completely forgot you added LaTeX support to that plugin! Maybe I should have read my own documentation :)

PHPirates avatar Feb 28 '24 19:02 PHPirates

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?

grafik

This is the content of my file:

.proper : latex propername
    TEXT → \propername{$expr$}$END$

anneborcherding avatar Feb 29 '24 07:02 anneborcherding

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 image

fberlakovich avatar Feb 29 '24 07:02 fberlakovich

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

fberlakovich avatar Feb 29 '24 07:02 fberlakovich

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 avatar Feb 29 '24 07:02 anneborcherding

@anneborcherding @PHPirates I guess we can close this issue?

fberlakovich avatar Apr 22 '24 08:04 fberlakovich

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)

PHPirates avatar Apr 22 '24 09:04 PHPirates

So for my concrete use case, I found a solution, but I agree with @PHPirates that an editor would be a great enhancement!

anneborcherding avatar Apr 23 '24 17:04 anneborcherding

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.

fberlakovich avatar May 20 '24 07:05 fberlakovich