mirror of
https://github.com/foambubble/foam.git
synced 2026-04-24 03:01:01 -04:00
* Use URI throughout dated-notes * Fix typos in comments * Allow absolute paths in `openDailyNote.directory` This allows users to press the `alt-d` shortcut to open the daily note from any instance of VSCode, not just within the `foam-template` repo.
50 lines
2.1 KiB
Markdown
50 lines
2.1 KiB
Markdown
# Daily notes
|
|
|
|
Automatically create a Daily Note by executing the "Foam: Open Daily Note" command. If a Daily Note for today's date already exists, the command opens the existing note.
|
|
|
|

|
|
|
|
## Keyboard shortcut
|
|
|
|
The default keyboard shortcut for "Open Daily Note" is `alt`+`d`. This can be overridden using the [VS Code Keybindings editor](https://code.visualstudio.com/docs/getstarted/keybindings).
|
|
|
|
## Configuration
|
|
|
|
By default, Daily Notes will be created in a file called `yyyy-mm-dd.md` in the workspace root, with a heading `yyyy-mm-dd`.
|
|
|
|
These settings can be overridden in your workspace or global `.vscode/settings.json` file, using the [**dateformat** date masking syntax](https://github.com/felixge/node-dateformat#mask-options):
|
|
|
|
```jsonc
|
|
"foam.openDailyNote.directory": "journal", // a relative directory path will get appended to the workspace root. An absolute directory path will be used unmodified.
|
|
"foam.openDailyNote.filenameFormat": "'daily-note'-yyyy-mm-dd",
|
|
"foam.openDailyNote.fileExtension": "mdx",
|
|
"foam.openDailyNote.titleFormat": "'Journal Entry, ' dddd, mmmm d",
|
|
```
|
|
|
|
The above configuration would create a file `journal/note-2020-07-25.mdx`, with the heading `Journal Entry, Sunday, July 25`.
|
|
|
|
## Daily Note Templates
|
|
|
|
In the future, Foam may provide a functionality for specifying a template for new Daily Notes and other types of documents.
|
|
|
|
In the meantime, you can use [VS Code Snippets](https://code.visualstudio.com/docs/editor/userdefinedsnippets) for defining your own Daily Note template.
|
|
|
|
## Roam-style Automatic Daily Notes
|
|
|
|
Foam provides an option for automatically opening your Daily Note when you open your Foam workspace. You can enable it by specifying the following configuration in your `.vscode/settings.json`:
|
|
|
|
```json
|
|
{
|
|
// ...Other configurations
|
|
"foam.openDailyNote.onStartup": true
|
|
}
|
|
```
|
|
|
|
## Extend Functionality (Weekly, Monthly, Quarterly Notes)
|
|
|
|
Please see [[note-macros]]
|
|
|
|
[//begin]: # 'Autogenerated link references for markdown compatibility'
|
|
[note-macros]: ../recipes/note-macros.md 'Custom Note Macros'
|
|
[//end]: # 'Autogenerated link references'
|