# 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.

![Daily note feature in action](../assets/images/daily-note.gif)

## 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

Daily notes can also make use of [templates](note-templates.md), by defining a special `.foam/templates/daily-note.md` template.

See [Note Templates](note-templates.md) for details of the features available in templates.

## 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'
