konodyuk / obsidian-text-expander Goto Github PK
View Code? Open in Web Editor NEWText Expander plugin for Obsidian
Text Expander plugin for Obsidian
Hi,
I've added trigger:
{
"regex": "^jira:",
"replacement": "[<text>](https://notmyrealsite.atlassian.net/browse/<text>)"
}
however when triggering with {{jira:PROJ-1234}}
the resultant output is:
[<text>](https://notmyrealsite.atlassian.net/browse/<text>)
rather than the expected:
[PROJ-1234](https://notmyrealsite.atlassian.net/browse/PROJ-1234)
Are there any pointers on how to get this to function?
I installed the plugin on my window 10 machine and found the setting for the executable not to work, obviously.
As a developer and Linux fan I use Windows Linux Subsystem (wsl) and tried that out.
Using the Shell executable with
C:\Windows\System32\wsl.exe
The first tests worked as excpected:
Could you - maybe add a note inside the documentation - or could we use a feature inside the plugin to default to this?
I tried adding a new shortcut:
{
"regex": "^brev$",
"replacement": "**\[Redacted for brevity\]**"
},
There is no save button. How can you miss something as obvious on a config UI as that? So I assume the plugin autosaves when I close the config. Now what if I don't want to save changes?
That is immaterial because the autosave doesn't work. It saves the Shell executable setting, and it saves half my new shortcut, the regex, but not the replacement.
I will look at a PR to help you, but really, do you test you work at all? Have you even tried using the plugin outside of your IDE?
That’s what I was looking for, not something I have to set up all over again, when Text Expander already has everything?
The real one is at:
and it works on Mac and iOS and iPadOS.
I use Obsidian a lot on my phone and my iPad. Text Expander is really useful on PC but when I tried to install it on mobile I can't enable it after installing. Is it possible to get this working on mobile, and if so, are you able to use it without having a keyboard attached to hit the Tab key? It would be really awesome if this could use some other prompt on mobile devices since there's not a Tab key on the on-screen keyboard.
Using this plugin on windows, with powershell set as the shell — I cannot discover how to add new triggers to the text expander. If I edit the window in the settings, my changes can't be saved and the new triggers disappear (though triggers I delete seem to stay deleted). I found a "data.json" file in the plugin's subdirectory, but this doesn't seem to get read. I have tried disabling and re-enabling the plugin. Doesn't help. Do I have to restart Obsidian or reload the vault for my changes to that file to be picked up?
It would improve the docs if you were to state clearly where and how people can add their own simple shell commands to the list of triggers.
It would be nice to have a different syntax for calling replacements.
I propose @trigger or ::trigger for this case, but if possible it should be configurable.
This would allow reusing trigger-words for different context. And this would give a mental context when something is a fast replacment or a potential slow call to an external process. For example, I use {{@py}} and {{@sh}} to insert code-fences for python- and shell-code, but typing this so often can be a pain.
Hi,
on widnows 10 the plugin didn't work as expected. It seems that the hotkey for "tab" was not set correctly.
On Linux & macOS it works as expected.
obsidian version: 0.13.33
best regards
When using the default {{sympy:}} syntax, I get a python error stating that <path-to-vault>/.obsidian/scripts/sympy-tool.py
is not found. I checked and indeed there's no /scripts folder at all. Looking at the readme, it says the examples folder contains two scripts, but the current commit's example folder only has one, main.py, that seems to do quite a bit more than just sympy.
What's the correct way to set up {{sympy:}}?
Hi,
I try (on Windows) to save this into the setting (the syntax) but I cannot seem to save it. Want to know if there's something wrong with the syntax.
Context: I am trying to have an expander for a format of table that I use frequently.
{
"regex": "^22$",
"replacement":
"
| | | |
| --- | --- | --- |
| | | |
| | | |
"
}
I want to get text like ## 2021.04.07 (Wed)
using this command:
today_str=`date +"%Y.%m.%d (%a)"` && echo "## $today_str"
But, I'm not sure how should I put this command in the configuration.
Specifically, how can I use double quotation mark in double quote?
{
"regex": "^standup$",
"command": "today_str=`date +"%Y.%m.%d (%a)"` && echo "## $today_str""
}
Thanks
For example, I want to automatically replace qq
to ?
. It's much quicker than {{qq}} Tab
. Is it possible?
Thanks for this plugin! It looks to be exactly what I need. Unfortunately I'm having trouble following the examples. It seems the API for custom tools changed recently and I'm unsure what should be specified in the plugin's settings and what should be in the <scripts_path>
folder.
For example, the default settings for the tool:
and sympy:
triggers still reference separate non-existent files (<scripts_path>/tool.py
and <scripts_path>/sympy_tool.py
respectively). They also use the cut
command to manually trim the trigger from the rest of the input text.
The new example script is called main.py
and seems to not only implement the sympy
example but to re-implement the now
command from the default settings too. The cut_prefix
argument suggests to me that it is no longer required to trim triggers from the command
specified in the settings but I can't be sure. I'm also unsure if I can just add new triggers by adding new handlers decorated with @handler.command
or if I also need to modify the Processor
or Handler
classes.
Also, the gif moves far too quickly for me to see what's really happening. I'd really appreciate some clear text documentation in the README on the best way to add my own commands, and what the relationship between the settings and any script files is 🙏🏻
After enabling plugin Obsidian doesn't respond. After killing app the plugin remains disabled. Obsidian v. 0.10,7
I'm using Obsidian v0.13.8.
Text expander stopped working, the Tab command just indent the {{trigger}} without actual substitution.
When I switched to the Legacy Editor at the Editor section, everything starts working again.
Getting an error when running, looks like it's thinking this is a completions endpoint instead.
I am trying to get the text expander to run a simple no-arguments python script with the following config:
{"regex": "^foo$",
"command": "python3 <scripts_path>/bar.py"
}
The bar.py
file has the following shebang line: #!/usr/bin/python3
python3 <scripts_path>/bar.py
runs fine if executed in the terminal (Ubuntu 20.04), where which python3
points to the same /usr/bin/python3
. But the text expander execution fails, because python cannot find the required modules (which have been pip3-installed system-wide).
I thought that maybe it somehow calls some different python binary, but the expander command {{shell: which python3}}
also outputs /usr/bin/python3
, as expected.
Obsidian was installed via flathub.
Your plugin looks really interesting, but I am on windows, so I cant use it right now. But it would be really helpful if you wouldn't place that information at the very bottom of the README. I was already thinking of some use cases, until I found that comment. It would not suprise me, if some windows users create an issue, because the plugin is not working, if the information is so well hidden.
Hello!
This is my Text Expander Shortcut:
[
{
"regex": "^rpc:",
"command": "echo <text> | cut -c 5- | python3 <scripts_path>/rpc.py"
}
]
And this is rpc.py:
print("[[" + input().replace(" ", "_") + "]]");
But when I hit tab, the cursor doesn't stay on the same line (as demo shows), it goes to a new line:
I want it to stay on the same line, as it's most convenient to me.
Can you help me?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.