I work in the medical field and use a software called Epic. In it, there is something called “SmartPhrases” or “dot phrases”. It works as: after pre-setting a smartphase called .test to “this will generate a test message this long”, when I type in the note .test and hit enter, it automatically generates “this will generate a test message this long” for me. Is there a way to do this in Obsidian?
There are two workaround available, which I’ve found so far. One is to use a fixed main.js linked from in that issue thread, and the other is to just disable the shortcuts in settings, and add your own hotkey.
So get it to work do the following:
Install the plugin “Text snippets” via Settings > Community plugins, and enable it
Goto the settings of the plugin, and add the text you want expanded into the large box (and disable the tab and Space expansion, as they don’t work anyways)
Goto Settings > Hotkeys and search for “run snippet replacement” (you only need to type parts of that), and hit the plus icon, and enter a hotkey of your own
Now when you type your smart phrase, you can hit that hotkey, and it’ll expand the text for you. You can even go to one of your smart phrases in retrospect, and hit the hotkey and it’ll expand it for you.
Do note that dot phrases are not supported out of the box, as it messes with the word delimiters. But if you remove period from the word delimiter characters in the bottom of plugin settings, you can use .test as a smart phrase as well. But then again, since you need to hit the hotkey, you could just use test as the smart phrase…
You can create template snippets for text of any length and insert them easily if you have a hotkey (I use CMD /) assigned to open the template modal. Templates are inserted at the cursor point without overwriting the existing text.
And if you use Apple devices, text replacements work in Obsidian, across OS platforms. Text replacements can be words, phrases, or multiple paragraphs of text.
In the latter, you can configure (write in) e.g. .test > .test A option, .test B option, etc. It is not automatically pasting in the lines though, you need to select from the list (and delete the dot afterwards).