Comments (9)
I would need to change an internal function in Obsidian, which I really don't want to. It could cause some strange side effects. And adding an extra command for this, is not enough, because there are many ways to create a new file.
from obsidian-hotkeys-for-templates.
Ah okay, thanks for the heads-up!
from obsidian-hotkeys-for-templates.
I have found a solution after all. Will do it now.
from obsidian-hotkeys-for-templates.
@Vinzent03: Wow, this is impressive and really helpful, thanks!
Q: Seems you use the same construct as Templater does (react on new file creation in vault). Would this conflict with Templater if I set both to "Trigger on new file creation"?
Because I have a Templater variable in there (<% tp.file.title %>
for first header) that worked before and now always shows "Untitled". Wonder if this is due to "who is first in the chain to handle an event" … It gets expanded, so I assume both of you correctly pass on so the next event handler can take it.
(And thanks for adding that switch!)
from obsidian-hotkeys-for-templates.
@Vinzent03: Another find:
I naively expected "Folder" to mean "this and all its subfolders", so if I have
- folder "People" assigned to "Template A"
- folder "People/Friends & Family" assigned to "Template B"
the following would happen:
- New note in "People" → Template A
- New note in "People/Notable" → Template A
- New note in "People/Friends & Family" → Template B (instead of Template A, because the definition is more specific)
This is from a usability standpoint: I may have, say, a "People" folder with "Friends & Family" and "Notable" subfolders. I would want to use the same template (A) for all kinds of "People", even if I created many new subfolders (without having to specify them all). Or I might rename a few subfolders and wouldn’t have to re-specify them all.
Then I would need a special Template (B) for "People/Friends & Family", so I specify it in settings. This would be applied instead of template A because the path is more specific. And it would also work for subfolders within "People/Friends & Family".
Could this be done? I guess some people might be quite happy about it. :-) (Yes, me too!)
Path "specificity" shouldn’t be too hard to establish, I think.
from obsidian-hotkeys-for-templates.
Would this conflict with Templater if I set both to "Trigger on new file creation"?
I wouldn't suggest you to enable both features. The filename for a new file is always Untitled
, why else did you expect?
Will see what I can do for your folder problem
from obsidian-hotkeys-for-templates.
Unfortunately, I do need Templater’s trigger to be also enabled (mainly for "New file from template", where I need the template to be executed in places not defined in Hotkeys for templates). But you are right, any file first gets created as "Untitled", so using that Templater variable was probably dumb. 🤣 I must have been thinking it was only done after assigning a name. My mistake.
Thanks a bundle for implementing the new file triggering and looking into the path thing, greatly appreciate it!
from obsidian-hotkeys-for-templates.
Is available in new release!
from obsidian-hotkeys-for-templates.
Perfect, works great! Thanks again!
Should probably be noted in the docs that if you use Templater’s "New note from template" or have set Templater’s "Empty file template", and both Hotkeys for Templates and Templater set to trigger on new file creation, both templates will be included in your note.
But I’m perfectly happy with that, can’t expect event chain handlers prioritization. And this would probably be over the head of typical user anyway.
from obsidian-hotkeys-for-templates.
Related Issues (19)
- Creation of a new note via link doesn't trigger the template insertion HOT 4
- Plugin Options blank on v0.12.12 HOT 12
- Variables in the template don't work here? HOT 1
- Wrap contents of template around selected text HOT 9
- Bug interacting with Templater HOT 2
- New file creation along with tp.file.move/tp.file.rename results in extra empty file HOT 2
- Bug when using hotkeys for templates that work on selected words. HOT 12
- (little) Conflict with "Filename Heading Sync" HOT 5
- When moving a template from folder, hotkeys for template doesn't update template path
- Invoke with Tab HOT 1
- If core Templates plugin is replaced with Templater (i.e. core plugin=off) it doesn't work
- It doesn't work for the subfolder of the path set in text field HOT 3
- Cannot configure the plugin in Preferences HOT 4
- [Feature request] Create note in a given folder from template HOT 3
- Not compatible with Templater v1.6.0 HOT 2
- After changing/removing "Add new note" entry, hotkey still available HOT 2
- Default Template doesn't work with nested folders HOT 5
- Applies the template twice HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from obsidian-hotkeys-for-templates.