obsidian-latex-suite icon indicating copy to clipboard operation
obsidian-latex-suite copied to clipboard

Can we have a separate file to save our settings?

Open willcai7 opened this issue 1 year ago • 11 comments

In vscode or vim, we have latex.snip to save all our settings. Right now, all the settings are within the plug-in setting. I am wondering if we could have a separate file. Then, we can use vscode or sublime to edit it. This will be much more efficient.

willcai7 avatar Jul 12 '22 04:07 willcai7

Yes, I can consider adding this in a future release!

I've tried to make the snippets editor as usable / close to an IDE as possible. It contains syntax highlighting, line numbers, keyboard shortcuts, etc., so should be good enough for most purposes. Just wondering which features in vscode / sublime you're missing?

artisticat1 avatar Jul 12 '22 20:07 artisticat1

Wow, that's an ambitious idea. To be honest, I think editing with Vscode is enough for me. Right now, I think the most important feature in Vscode and sublime is search and replace.

Besides, I meet some bugs recently. I was trying to type \otimes and \varphi in Latex. But I always get \o\times and \var\phi. I cannot find any options to stop the auto completion. Do you have any idea?

willcai7 avatar Jul 13 '22 04:07 willcai7

I'll try to issue a fix for those issues today.

artisticat1 avatar Jul 13 '22 10:07 artisticat1

Search and replace is available if you press Ctrl+F.

artisticat1 avatar Jul 13 '22 10:07 artisticat1

\otimes and \varphi are fixed in the next release. In the meantime you can create snippets for \otimes and \varphi, and place them at the top of your snippets or give them a higher priority.

artisticat1 avatar Jul 13 '22 21:07 artisticat1

Search and replace is available if you press Ctrl+F.

Cool! Can we have a pop-out window for the editor? Right now, we can only see very few lines of the settings.

willcai7 avatar Jul 14 '22 17:07 willcai7

\otimes and \varphi are fixed in the next release. In the meantime you can create snippets for \otimes and \varphi, and place them at the top of your snippets or give them a higher priority.

Thanks! May I ask what snippets lead to the bug? I didn't find any snippets related to it.

willcai7 avatar Jul 14 '22 17:07 willcai7

Can we have a pop-out window for the editor? Right now, we can only see very few lines of the settings.

Ah, I see. This is out of scope at the moment, but any PRs to add this or the ability to save snippets in a separate file are welcome!

Thanks! May I ask what snippets lead to the bug? I didn't find any snippets related to it.

The issue was that varphi wasn't in the list of greek letters, and times appeared before otimes in the list of symbols. This meant "times" was matched before "otimes".

However otimes works on my machine even times is placed before otimes, so I'm not sure what's going on here.

artisticat1 avatar Jul 16 '22 10:07 artisticat1

I second this. Even though the embeded editor of this plugin is the smoothest one of all plugins I've used, but I think a great advantage of storing the config in a separate file is that we can backup and read the config more conveniently.

I know these two plugins store the config in a separate file:

If this feature gets supported, it would be even better if we can specify the config file location XD

zcysxy avatar Jul 19 '22 06:07 zcysxy

Sounds good! Thanks for linking those plugins, I'll have a look at them for reference. I'll definitely include an option to select where the config is stored!

artisticat1 avatar Jul 19 '22 08:07 artisticat1

I like this. It would also enable sharing of config files through github. This could be massive because the useful snippets vary depending on your field.

mscott99 avatar Jul 24 '22 16:07 mscott99

Seconding this, it could be very useful, especially to use the same snippets on mobile (plugin settings don't always sync) or on different vaults ! Also thanks a lot for the plugin, it's awesome !

loune20 avatar Oct 03 '22 14:10 loune20

Added in 1.6.0!

artisticat1 avatar Oct 15 '22 11:10 artisticat1

Hi @artisticat1, thanks for implementing this feature! It works like a charm. A small additional fr on this: could it read the settings file in a hidden directory like .config/?

zcysxy avatar Oct 15 '22 20:10 zcysxy

Hi @artisticat1, thanks for implementing this feature! It works like a charm. A small additional fr on this: could it read the settings file in a hidden directory like .config/?

Sure, open a separate issue and I can look into this!

artisticat1 avatar Oct 16 '22 11:10 artisticat1