Awesome
Text-expander
A bare-bones proof-of-concept implementation of a simple text-expander in Obsidian.
- Uses
::
(two colons) to start the trigger-sequence - Define your own custom trigger keyword like
foo
- In the editor, type <kbd>::foo</kbd> + <kbd>ENTER</kbd> (or <kbd>Tab</kbd> or <kbd>Space</kbd>) to expand
Built-in is <kbd>::date</kbd> which will expand to todays date such as Mon Nov 09 2020
and <kbd>::time</kbd> which will expand to your current timezone's time.
Demo
Settings
Hacking and Help
This is mostly a proof of concept for myself and it's rather, erm, "pragmatic" code. If you see something you'd like to change, let me know. Here's how you can fiddle around on your own yourself and send a pull-request
Clone and make new branch
cd $VAULT/.obsidian/plugins
git clone https://github.com/akaalias/text-expander-plugin
cd text-expander-plugin
git checkout -b my_branch
git remote add upstream https://github.com/akaalias/text-expander-plugin
Install deps
npm i && npm install -g prettier && npm install -g eslint
npm run dev
Edit
git checkout -b my_branch
- Make your edits
- To check your changes, reload Obsidian (Command-R)
Commit-prep
./ship.sh
will prettify and elsint once againgit add -p
to stage changes individuallygit commit -m "my message"
Publish pull request
git push -u origin my_branch