Tidy Titles

approved

by Magnus Wållberg

Slugify filename from note title - This plugin has not been manually reviewed by Obsidian staff.

1 stars23 downloadsUpdated 15d agoMIT

Tidy Titles

An Obsidian plugin that keeps your filenames tidy while preserving the human-readable title.

When you create a note and give it a name like This is my Node, Tidy Titles:

  1. Slugifies the filenamethis-is-my-node.md (lowercase + hyphens by default, configurable).

  2. Stores the original title in frontmatter so nothing is lost:

    ---
    title: This is my Node
    aliases:
      - This is my Node
    ---
    

Pair it with the Front Matter Title plugin to display the original title in the file explorer, tabs, and graph while the files on disk stay slug-clean.

Features

  • Hooks Obsidian's native "New note" — create a note, type its name, and the filename is slugified and frontmatter is added automatically. Only acts on new, empty notes, so it never clobbers existing content or ordinary renames.
  • New note from title command — a modal prompt with a live slug preview. Bind it to Ctrl+N (and clear the core "Create new note" hotkey) in Settings → Hotkeys if you'd rather name a note in a modal up front than tidy the inline name afterwards. New notes go wherever Obsidian's Default location for new notes setting points.
  • Rename note title command — the way to change a note's title: a modal prefilled with the current title: lets you edit it, then updates the frontmatter title/aliases and re-slugifies the filename to match. Also available by right-clicking a note in the file explorer, on a tab, or in the editor, and bindable to a hotkey via Settings → Hotkeys. Alias handling on rename is configurable (see Keep previous aliases on rename below).
  • Rename current note to slug of its title command — re-slugifies an existing note from its title: frontmatter (or its current filename), without changing the title.
  • Rename current note's folder to a slug command — tidies imported or oddly-named folders.
  • Backlink-safe — renames use Obsidian's fileManager.renameFile, so links to the note are updated automatically.

Configurable slug rule

The transform is a configurable regex replace (Settings → Tidy Titles):

SettingDefaultMeaning
Hook Obsidian's "New note"onintercept native new-note creation
Lowercaseonlowercase the title before applying the pattern
Pattern\s+regex of characters to replace
Flagsgregex flags
Replacement-string each match becomes
Trim character-strip this char from the start/end of the result
Add aliasesonalso write the title to the aliases list
Keep previous aliases on renameonon rename, keep earlier titles as aliases (link-safe); off replaces them with just the new title

The defaults produce a kebab-case slug: This is my Nodethis-is-my-node.

For a strict slug that also drops punctuation while preserving Unicode letters such as å ä ö, set:

  • Pattern: [^\p{L}\p{N}]+
  • Flags: gu

e.g. FSX: To Buyfsx-to-buy.

The settings tab shows a live preview so you can see what your regex produces.

Installation (manual)

This plugin is plain JavaScript and requires no build step.

  1. Copy main.js and manifest.json into <your-vault>/.obsidian/plugins/tidy-titles/.
  2. In Obsidian, open Settings → Community plugins, then enable Tidy Titles.

License

MIT

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.