noam-sc / obsidian-enhanced-symbols-prettifier

Symbols that prettify your knowledge base.
MIT License
6 stars 0 forks source link

Triggers and Limits for Symbol Replacement #7

Closed 3089488 closed 1 week ago

3089488 commented 2 weeks ago

When writing notes it is common for me to define a symbol by giving its name as well, such as Sigma (Σ). I have found that symbols are not automatically converted when preceded by something that is not whitespace. It is not a necessary feature but it would be convenient. Additionally, ending a word with a symbol does not trigger a replacement of the string, only the Space key triggers it.


Examples of when this would be useful:


Suggestions:

Limits:

Triggers:

noam-sc commented 2 weeks ago

Thanks for the detailed feedback and suggestions!

You're right, the current behavior only triggers replacement with a space. I agree that enabling replacements after punctuation, with the Enter key and words delimited by other caracters would be useful. I'll explore adding this as a settings option.

For the escape character, I think it's better the other way around. In my view, defining the shortcut ~sigma (or \sigma) to be replaced by Σ is more intuitive than ~sigma not being replaced by Σ. It also avoids the interference with other replacements.

To address unwanted replacements, I'm considering an undo option by pressing Backspace right after a replacement to revert it (similar to smartphone autocorrect). Tell me what you think about it.

3089488 commented 2 weeks ago

Reading my suggestion back, I totally understand why you wouldn't use an escape character. It doesn't make a lot of sense and would be difficult to implement in an intuitive way. I guess I didn't think that one far enough out 🤔.

As for adding Backspace to undo a replacement, I think that would definitely solve or at least reduce most of the cons inherent to reducing limits on symbol replacement.

Thanks for hearing my suggestion out, I'm trying to set up Obsidian for organizing my notes in college and your plugin is a great help for quickly typing math stuff.

noam-sc commented 1 week ago

Hey @3089488, the latest update (1.4.0) added the ability to revert a replacement by pressing backspace and flexible word boundaries (for both words start and end). For now, it doesn't work with the Enter key.