Tags
Tags in plain Markdown notes.
Mark a note with #reading or #work/project
right in its text, browse every tag in the sidebar and rename a tag
across the whole folder. The tags stay ordinary text in your own
Markdown files. MarkdownMate does it on Mac and Ubuntu, with no
account and no database.
Write a tag anywhere in a note
Reading list for the trip #reading #travel
Status of the launch plan #work/project
Type #tag anywhere in a note. A slash makes a nested tag: #work/project sits under #work. Tags are colored in the editor, and shown colored in the preview too (as chips on Ubuntu).
What is not a tag
On Ubuntu a tag starts with a letter, so #1 is not a tag, and the # of a heading, code and URLs or links never make one: https://example.com/page#section stays a link. On Mac, Rename Tag leaves tags in code, links and URLs alone, and a longer tag such as #older is not touched when you rename #old.
Tags in YAML front matter
---
tags: [work, work/project]
---
Tags listed in a note's front matter count too. Use a list in brackets, a block list of - work lines, or a comma-separated tags: work, home; the key may also be tag:, and the leading # is optional. They appear in the Tags section, in # completion and in Rename Tag. They aren't colored in the editor. On Ubuntu, values that are not valid tags are skipped.
The Tags section in the sidebar
With a folder open, the sidebar's Tags section lists every tag in it as a tree, split at each /. Open a tag to see its notes and click one to open it. The same folder gives the same tags on both apps; the details differ a little:
- Mac: expand a tag to see its notes. ⌘-click a tag in the editor, or click it in the preview, to jump to it in the sidebar.
- Ubuntu: each tag shows its number of notes, and a note tagged
#work/projectalso counts for#work. Click a tag to list its notes. The list updates in the background after notes change on disk (after saving).
Complete a tag as you type
Type # and a letter and a list pops up with the tags already in the folder, most used first. Keep typing to filter. On Mac press Return to insert and Esc to close; on Ubuntu use Up and Down, Enter or Tab to insert and Esc to close. On Ubuntu it matches by prefix or letters in order, and doesn't appear in code or in a heading's #. On Mac, the first tag you type in a folder reads its tags in the background first.
Rename a tag across the folder
Right-click a tag in the Tags section ▸ Rename Tag…. MarkdownMate tells you how many notes will change before anything is written, then turns #old into #new in every note of the folder. Nested tags move with it (#old/child becomes #new/child), and so do front-matter tags: values. Longer tags such as #older, and tags in code, links and URLs are left alone. Renaming to a tag that already exists joins the two.
The open note changes in its editor, so ⌘Z on Mac or Ctrl+Z on Ubuntu undoes it. Other notes are written only if they haven't changed on disk since they were read; on Ubuntu a note edited elsewhere in the meantime is skipped.
Tags are text, so Git and sync keep them
A tag is just characters in your .md file. There is no tag database to export or lose: the files stay plain Markdown, so they open in any editor, and a copy of the folder, a Git repository or a sync service carries the tags along. With iCloud on the Mac, the Tags section skips notes that aren't downloaded to the Mac, so it doesn't download your whole folder.
Mac and Ubuntu
Both apps read and write the same tags, so one folder works on both. The differences are small:
- Jump to a tag: ⌘-click it in the editor, or click it in the preview, on Mac. On Ubuntu, click a tag in the sidebar to list its notes.
- Completion keys: Return on Mac, Enter or Tab on Ubuntu.
- Undo a rename: ⌘Z on Mac, Ctrl+Z on Ubuntu.
More about wiki links, daily notes and templates is on notes in Markdown; links between notes are in wiki links and backlinks.
Get MarkdownMate
Free on the Mac App Store and the Ubuntu PPA. No account, no subscription.
Get MarkdownMate
Ubuntu
sudo add-apt-repository ppa:homielab/markdownmate
sudo apt update
sudo apt install markdownmate
Ubuntu 24.04 or later (amd64)
No account, no cloud: notes stay as .md files on your disk.