-
-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can a template action be based on the "current selection" in the editor? #44
Comments
current poor man's hack is to copy the word to the clipboard first and then use this as the template src: w=$(pbpaste)
q=$(python3 -c 'import sys; from urllib.parse import quote; print(quote(sys.argv[1]));' "$w")
echo "[$w](https://www.google.com/search?q=$q)" |
Seems operating on the current selection is indeed possible, see https://github.com/lukeleppan/better-word-count/blob/master/src/main.ts#L33 for an example |
Hello @luckman212, that's a good internal template idea ! |
Hey @luckman212, sorry for the late response, this has been implemented as of Templater 1.0.0! |
Not sure if I am even asking this in the right way, but here's my use case:
I'd like to create a template that uses the current selected word or phrase as a parameter for the template. One example could be a "turn selection into linked Google search":
[Zettel](https://www.google.com/search?q=Zettel)
Is this possible today or somehow in the future?
The text was updated successfully, but these errors were encountered: