I always have my daily note pinned in the topleftmost pane.
But each morning my workflow is a bit cumbersome:
Remember to unpin yesterday’s note
Click the Open Today’s Note button
Repin today’s note
Ideally I would just need to click the Open daily note button (or use the associated keyboard shortcut) and that would update the same pane with today’s new note, not open it in a new pane. Or even better, the daily notes plugin would prompt me to do this the first time I open Obsidian on a new day.
I’m not sure of the best way to implement this. Perhaps treating today’s daily note as a special type of pane.
One way to implement this could be to add the ability to pin folders, ie to restrict a pane to only opening links from a certain folder (presumably your daily notes folder). Whenever you try to open a link to a note from anywhere in the app, if there is a pane that is pinned to the folder that the note is in, then that pane would behave as if it is not pinned during this situation. In code, you could do that by altering the functionality of a pin or by automatically un-pinning and re-pinning affected panes (exactly as OP is doing).
This would be pretty useful functionality for MOCs too. In addition to folder-pinning, you could also do tag-pinning, where a pane can only open notes with a given #tag.
I also would like to be able to pin a daily note and have the pin advance each day to the next daily note. Perhaps an alias? The alias always points to the current daily. Allow us to pin the alias rather than the actual daily note. BTW, the thing I want to pin this way is the outline of the current daily note.
An interesting way to tackle this could be to add the ability to pin a note into the templating system. So I could add “PINME” to my template, and voila.
+1 - I came looking to see if there was a way to do this already that I’d missed. I’d settle for a way to just auto-pin today’s daily note but the OP’s request is much nicer, more powerful, alternative.
(The console.log() message is not necessary, but I had the console open to see if I was breaking anything, so added it as a check…)
Then in my Daily Note template I have a line with <% tp.user.pin_me() %>.
This seemed to work fine except, initially, the tp code above was replaced with the text ‘undefined’, I guessed because the function didn’t originally return anything. I “fixed” that by returning an empty string but I’m not sure if that’s the right JS way to do it, or indeed if I need all those semi-colons Either way, my Daily note now pins itself on creation.
I am using this on my PKM for example for my courses section.
When I click a course note, it executes a command sequence.
e.g: When I open a course note:
Close left sidebar;
close right sidebar;
pin course note;
close others notes;
open a course into a frame through plugin “Custom Frames”
It is necessary Force note view note, templater, Custom Frames because I wanna when I click on the note, force to open it on preview mode and execute templater script at “run:”
I like the templater workaround ideas. I might even install templater for this. I also think it would be nice if the above could just be the default behavior for the daily note when pinned.