Foam: Add 'Open Daily Note' Command

Created on 4 Jul 2020  路  6Comments  路  Source: foambubble/foam

In Obsidian (and Roam I think), there is a concept of a daily note. I wish there were a VS Code command to "Open Daily Note"

  • If there is no note for current date, it creates a new one
  • If there is, it goes to that note and opens in Workspace
  • If a user has a foam.config.js and there is a value for dailyNotesDir, then the notes are saved there. Default is root.

    • let user configure the format of the date for filename

Thoughts?

enhancement foam-vscode help wanted

Most helpful comment

@francishamel that would be awesome! I wrote down some requirements here:
https://foambubble.github.io/foam/daily-notes

These are off the top of my head. If you don't think these fit your use case, let me know and we can iterate!

If you have questions, feel free to ask here or head over to the Foam Discord and ping me there!

All 6 comments

@jsjoeio thanks for the suggestion! This item is already on the roadmap, and since it's relatively easy to implement, I wouldn't mind prioritising it relatively highly:
https://foambubble.github.io/foam/daily-notes

At a high level I like your workflow, but few notes on the config format:

  • I'd like to use VSCode user/workspace settings for these, e.g. foam.dailyNotesDir in .vscode/settings.json so that they can be globally set for all workspaces based on user preference.
  • We should also configure date format in file name, e.g. yyyy-mm-dd etc.
  • We should also configure heading format, e.g. dd M YYYY (or whatever that may be)
  • All configurations should have defeaults

In the roadmap item there are a a couple open questions, e.g. would there be a way for us to reverse sort the files so that the newest stays on top (can't think of any).

I'll mull this over and get the roadmap item updated with the details, but I doubt anything will substantially change.

If anyone wants to start working on it, let me know!

Looking at the linked roadmap item, I wonder if the points about sorting and using a directory could be related. Using directories to isolate top level collections seems like a common use case, so I wonder if Foam could somehow provide a default directory listing view, with the ability to override/customize? I guess it'd need to generate index.md files, but maybe things like sort direction could just be a flag in the config? foam.dailyNotesDir: { path: "...", sort: -1 }

@bclinkinbeard a custom bubble explorer instead of a vanilla file explorer is a good idea and would make it possible to do other fun stuff (such as showing titles and abstracting file names, doing custom context menu actions (rename, that renames all references, more).

On the downside the engineering cost is quite high, so that's not going to be a high priority for me, but if someone wants to run with it and make it, I'd be happy to collaborate on it and make sure it gets integrated into Foam!

I'd like to contribute to this project and I feel like I could tackle this task.

@francishamel that would be awesome! I wrote down some requirements here:
https://foambubble.github.io/foam/daily-notes

These are off the top of my head. If you don't think these fit your use case, let me know and we can iterate!

If you have questions, feel free to ask here or head over to the Foam Discord and ping me there!

this was implemented in #79 馃コ

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amorriscode picture amorriscode  路  6Comments

jmg-duarte picture jmg-duarte  路  5Comments

raguay picture raguay  路  8Comments

SpaceForever picture SpaceForever  路  6Comments

srid picture srid  路  3Comments