Footnote Shortcut

by Alexis Rondeau, Micha Brugger
5
4
3
2
1
Score: 88/100

Description

Category: Note Enhancements

The Footnote Shortcut plugin is designed to make inserting footnotes in Obsidian a breeze. With this plugin, you can easily insert numbered or named footnotes with auto-incremented indices, and quickly switch between your footnote markers and their corresponding details. The plugin also includes features like automatic footnote suggestions and customizable heading for separating footnotes from the rest of your note. Additionally, you can jump back and forth between footnotes and their details with ease. Whether you're a student, writer, or researcher, this plugin is sure to simplify your note-taking experience in Obsidian.

Reviews

No reviews yet.

Stats

174
stars
143,902
downloads
18
forks
2,029
days
2
days
11
days
11
total PRs
0
open PRs
2
closed PRs
9
merged PRs
46
total issues
2
open issues
44
closed issues
484
commits

Latest Version

12 days ago

Changelog

Massive updates and improvements since 0.1.3 (August 2023). The plugin has been rewritten and expanded to integrate with Obsidian's new native footnote features, and provide a comprehensive footnote-editing featureset.

Requires Obsidian 1.13 or newer. Your hotkeys and settings migrate over.

Highlights

  • Popup editor. Creating or visiting a footnote opens its text in a small editor right at your cursor. The same hotkey closes it, so you never scroll to the bottom of the note (issue #42). Turn off Edit footnotes in a popup for the classic jump.
  • Selection to footnote. Select text and press a footnote key: the numbered key moves it into a new definition, the named key asks for a name, the inline key wraps it in place. Multi-paragraph selections, code blocks, callouts, math, and whole tables travel intact (issue #35).
  • Rename footnote. Every reference and the definition take the new name in one step, from the command or the right-click menu, like renaming a variable in a code editor (issue #36).
  • A built-in linter. The Lint footnotes command moves references after punctuation, gathers definitions under your footnotes heading or at the bottom, fixes definitions hidden by a missing blank line, alerts on or deletes orphans, alerts on or merges duplicate definitions, and renumbers everything in order of appearance. Every rule is a toggle, and it can run on save or on every footnote creation.
  • Per-note footnote prefix. Give each chapter note its own prefix ([^2-1], [^2-2], …) so footnotes stay unique when the chapters are merged with Longform or Easy Bake (issue #31). The Set footnote prefix command writes it as a note property.
  • Inline footnotes. Insert inline footnote types ^[] and hops the cursor out on the second press; Insert inline footnote from clipboard wraps what you copied, flattened and escaped (issue #19).
  • Multiple cursors. Every footnote key works at several carets at once: the same numbered reference everywhere with one definition, or a skeleton at each caret so you type the name or text once.
  • Tables. Footnotes from inside a table cell work with the 1.5+ table editor: the reference lands in the cell, the definition below the table (issue #28).
  • Mobile. Every command sits on the mobile toolbar with its own icon, the dialogs are Obsidian's own kind of bottom sheet and stay above the keyboard, and the popup works on the phone.

Added

  • Insert footnote reference at end of word (on by default): a press mid-word places the reference after the word, past any closing quotes, brackets, or emphasis and the punctuation after them, the placement every major style guide recommends (issue #23; PR #52 by @chrisgrieser).
  • Expand selections to whole words (on by default): a sloppy drag still converts cleanly.
  • Footnote section heading improvements: any heading level or multi-line markdown, with an optional divider, reused when it already exists in the note (issues #27 and #57; PRs #32 by @cwlls and #47 by @Mase3206).
  • New definitions land after the last existing definition or under the section heading wherever it sits, with a blank line separating them from prose (issues #55).
  • Trim blank lines toggle: keep or trim the stray blank lines at the end of the note when the first footnote is added (PR #37 by @HyperEpsilon).
  • Navigation jumps set a vim jump point (PR #53 by @chrisgrieser) and land the cursor centered in the viewport.
  • Consecutive footnotes: pressing the numbered key right after an existing reference inserts the next footnote instead of navigating (issue #49).
  • Lint alerts that name every footnote involved: unnamed [^] references, orphans, hidden definitions, duplicates, names Obsidian can't render or find, and nested footnotes.
  • A notice when undoing a table-cell footnote has only removed the definition, and whether a second undo removes the reference.
  • Hand-drawn icons for every command, a funding link, and an MIT license (issue #58).

Changed

  • The numbered command is Insert / navigate numbered footnote (was "Auto-Numbered"); the ids are unchanged.
  • Footnote names are case-insensitive, matching Obsidian, and can't contain spaces, backticks, brackets, or #; the plugin refuses those and tells you why.
  • Footnotes are never created inside code, math, comments, frontmatter, or another footnote's definition, where they would be invalid (issue #41). A key pressed inside a definition jumps back to the reference instead.
  • A [^x]: line directly under a paragraph is plain text to Obsidian, and the plugin agrees: the linter inserts the blank line it needs.
  • %% comments are read the way Obsidian reads them: a reference inside one is real but hidden, a definition inside a %% block is not.
  • Linting writes back only the characters that changed, so your cursor and folds stay where they were.
  • Any footnote key pressed on a half-built footnote (a named reference without its definition, an inline ^[] still being typed) continues that footnote instead of nesting a new one.
  • The text-editing commands are inert in Reading view instead of editing the hidden buffer.
  • The autosuggest feature is gone: Obsidian has offered footnote suggestions natively since 1.6.
  • Settings use Obsidian's declarative settings API (issue #57), with the linter on its own page and the Linter-plugin warning for users of both.

Fixed

  • Table corruption when inserting from a cell (issue #28); a crash when the editor had no data (issue #39); the Android load failure (issue #46).
  • Dozens of scanner edge cases found by property-based testing and adversarial bug hunts: CRLF notes, fences inside callouts and lists, unclosed fences and comments, escaped and backticked openers, indented and blockquoted definitions, math delimiters, mixed line endings.

For contributors

  • Vitest unit suite (1600+ tests) with fast-check property tests and a micromark differential oracle, a live smoke suite driven through the Obsidian CLI, ESLint with the Obsidian guidelines, knip, and Stryker mutation testing. See CONTRIBUTING.md and TESTING.md.

Thanks to everyone who opened issues and sent pull requests since 2023, and to the BRAT testers of the sixteen betas.

README file from

Github

Footnote Shortcut

Obsidian Downloads Active Development Release Version

Create, navigate, and edit Obsidian footnotes all from the keyboard:

  • One hotkey for footnote creation/editing: insert a new footnote, and jump between the footnote reference and its definition
  • Popup editor: edit the footnote right at your cursor, no scrolling to the bottom
  • Numbered, named, and inline footnote styles
  • Selection to footnote: turn text you already wrote into a footnote with one press
  • Rename a footnote everywhere at once, like renaming a variable in a code editor
  • Footnote linter to keep footnote formatting tidy
  • Per-note footnote prefixes keep footnotes unique even when multiple chapters are merged into a larger document, such as with the Longform or Easy Bake plugins
  • Works on Obsidian Mobile

One hotkey opens the popup at the cursor, a named footnote lands at two cursors at once, a right-click renames it everywhere, and the linter tidies up

Support the plugin

If this plugin has made your writing a little smoother, you can buy me a coffee. Tips go toward the hours I spend on bug-hunting, feature requests, and keeping up with Obsidian releases.

Support me on Ko-fi

Bug reports and feature ideas on the issue tracker are just as welcome.

FIRST: set up your hotkeys

The plugin adds its commands without hotkeys, so assign your own right after installing by going to:

Settings → Hotkeys → search for "Footnote Shortcut" → click the ⨁ next to a command → press your preferred keys

Of the plugin's 7 commands, the ones you'll press constantly should have hotkeys. I personally use:

Command Recommended hotkey
Insert / navigate numbered footnote Alt+0
Insert / navigate named footnote Alt+-
Insert inline footnote Alt+=
Insert inline footnote from clipboard Alt+Shift+=

The other 3 (Lint footnotes, Rename footnote, and Set footnote prefix) come up less often, so running them from the command palette works fine. Give them hotkeys too if they become part of your routine.

Everything also works on mobile from the toolbar, each with their own unique toolbar icons.

Creating footnotes

Numbered footnotes

Put your cursor where the footnote belongs and press the hotkey. The plugin finds the next free number, inserts the reference (say [^1]), creates the matching [^1]: definition at the bottom of the note, and lets you type the definition text immediately.

Footnotes are never created inside code, math, comments, frontmatter, or another footnote's definition, where they would be invalid. The plugin refuses in those locations and alerts you.

Numbered footnote: the hotkey inserts the reference, the popup opens at the cursor, the definition is typed, the same hotkey closes it

Named footnotes

Named footnotes (like [^smith2024]) take 2 quick presses:

  1. First press inserts an empty reference [^] with your cursor between the brackets. Type the name.
  2. Second press (with your cursor still on the reference) creates the matching [^smith2024]: line and lets you write the definition text.

Names can hold almost anything ([^smith2024], [^arXiv:1234.5678], [^注]). The exceptions are spaces, backticks, brackets, and #, which Obsidian can't render or find. The plugin refuses those invalid characters and alerts you.

Named footnote: the first press plants the empty reference, the name is typed, the second press writes the footnote

Inline footnotes

2 commands cover Obsidian's inline ^[...] style:

  • Insert inline footnote places ^[] with your cursor inside, ready to type. Press the hotkey again when you're done and the cursor hops out past the closing bracket, so you never need the arrow keys.
  • Insert inline footnote from clipboard wraps whatever you've copied into ^[...] in one press. Multi-line clipboard text is flattened to one line, and anything that would break the footnote (e.g. stray brackets) is escaped automatically.

Inline footnotes: one typed in place and hopped out of, then the clipboard wrapped in one press

Inside tables

Footnotes work in table cells too: the reference goes into the cell and the definition lands below the table. Undoing a footnote made from a cell can take 2 undos, because the cell and the note are separate editors. A notice tells you when the first undo has only removed the definition, and whether a second undo removes the reference too.

Turn selected text into a footnote

Sometimes you write something mid-sentence and realize it should be a footnote. Select it and press a footnote hotkey:

  • The numbered hotkey replaces the selection with the next numbered footnote reference and moves the selected text into that footnote's definition. Multi-paragraph selections work too: the whole block becomes one multi-paragraph footnote, including whole code blocks, callouts, etc.
  • The named hotkey asks you for a name first, then does the same under [^yourname]. Confirm with Enter, the Create button, or just press any footnote hotkey again.
  • The inline hotkey wraps the selection as ^[...] right where it is. It accepts single-line selections only, as only those format correctly. For a multi-line selection, it points you to the previous 2.
  • A selection that starts or ends mid-word grows to whole words first, plus one trailing punctuation mark, so a sloppy drag still produces a clean footnote. Turn Expand selections to whole words off in the settings if you want the exact selection.
  • A selection that contains/cuts-through an existing footnote refuses to convert, as footnotes can't be nested inside other footnotes. Nesting is prevented throughout the plugin, and linting alerts you if a note already has hand-typed nesting.
  • Tables: text inside one cell converts, as well as a whole table selected edge to edge (with or without the text around it). A selection that cuts through a table's pipes refuses, to avoid breaking the table.

Selection to footnote with the numbered, named, and inline keys

Creating footnotes at multiple cursors

Multiple cursors (Alt+click) get the same footnote at every one of them, handy when one source is cited in several places:

  • The numbered hotkey puts the same [^N] at every cursor, sharing a single definition.
  • The named hotkey drops footnote brackets around every cursor and leaves a cursor inside each pair, so you type the name once and it lands everywhere. Press the hotkey again with the cursors still inside to create the shared definition.
  • The inline hotkey also drops footnote brackets around every cursor, so you type the footnote text once and it lands everywhere.
  • Pasting as an inline footnote wraps the same clipboard text at every cursor.

If any cursor sits where a footnote can't go, nothing is inserted anywhere. Every multi-cursor insertion ends with a single cursor after the first reference.

Multiple cursors: the numbered, named, inline, and clipboard keys put the same footnote at every cursor

Navigating footnotes

The insert hotkeys double as navigation. What they do depends on where your cursor is:

  • On a footnote reference (inside [^3] in your text): open its definition in a popup right at your cursor (or by jumping to the definition, when the footnote popup is off).
  • On a footnote definition at the bottom (a [^3]: … line): jump back to where its reference is used in your text.
  • Anywhere else: insert a new footnote, as described above.

One hotkey takes you back and forth between a reference and its note.

Navigation: on a reference the hotkey opens its definition in the popup; on the definition it jumps back to the reference

Renaming a footnote

Put your cursor on any reference or definition and run Rename footnote. It works like renaming a variable in a code editor: every reference and the definition get the new name in one step. It's also in the right-click menu when you click on a footnote, just like Obsidian's own rename for headings. Names are case-insensitive, so [^Note] and [^note] count as the same footnote. The command refuses names that are already taken and names a footnote can't have, and under a per-note prefix the new name gets the prefix added for you.

Rename footnote: every reference and the definition take the new name together

The popup editor

Creating or visiting a footnote opens its definition text in a small editor right at your cursor, so you never lose your place in the note. Close it with the same hotkey, Escape, or by clicking anywhere outside. Switching to Reading view closes it too. If a footnote has more than one definition, the hotkey jumps to the last definition instead (the one Reading View renders) so you can sort it out (or let the linter merge them). If you prefer the classic jump-to-the-bottom behavior, turn off Edit footnotes in a popup in the settings.

Keeping footnotes tidy: the linter

Writing and revising can leave footnotes messy. The Lint footnotes command cleans up the whole note in one pass:

  • Move footnote references after punctuation: Moves references that sit before punctuation, or inside closing quotation marks, brackets, or emphasis, to sit after them (word[^1]. becomes word.[^1], and "quote[^1]". becomes "quote".[^1]), the placement every major style guide recommends.
  • Gather definitions: Moves every footnote definition under your specified footnote section heading, or to the bottom of the note.
  • Fix definitions hidden by a missing blank line: a [^1]: line typed directly under a paragraph is plain text to Obsidian, and its footnote never shows. The linter inserts the blank line it needs (or, with the rule off, alerts you about it).
  • Alert/delete orphans: Orphans are footnote references without a definition or definitions without a reference. You choose whether the plugin alerts you or deletes orphans.
  • Merge duplicate definitions: if you accidentally have multiple definitions for the same footnote name, the plugin can alert you or merge them into one.
  • Reindex: renumbers footnotes 1, 2, 3… in the order they appear and reorders their definitions to match. Named footnotes keep their names (or get numbers too, if you enable Renumber named footnotes).

Lint footnotes: references move past punctuation, numbering follows the text, definitions gather at the bottom

Each rule can be toggled individually in Settings → Footnote Shortcut → Linting, along with 2 automatic triggers (both off by default):

  • Lint on save: lints the note whenever you press Ctrl/Cmd+S (vim users: :w works too).
  • Lint on footnote creation: lints the note right after you create a new footnote.

The linter also watches for problems it can't fix by itself and tells you about them, naming every footnote involved:

  • an empty [^] reference you never named, references with no definition or definitions nothing uses (while delete orphaned references/definitions are off)
  • a definition typed directly under a paragraph with no blank line above it as Obsidian shows it as plain text (while Fix definitions hidden by a missing blank line is off)
  • duplicate definitions (while Merge duplicate definitions is off)
  • names a footnote can't have (spaces, backticks, brackets, #)
  • footnotes nested inside another footnote's definition.

For chapter notes: per-note footnote prefix

If you're writing a book via chapter notes (e.g. when using the Longform or Easy Bake plugins), plain numbering collides when you merge the chapters back together: every chapter has its own [^1], so Obsidian confuses footnotes from chapter 1 with those from every other chapter.

To fix this, turn on Per-note footnote prefix and give each chapter its own unique prefix, so footnotes stay unique across the whole book:

  1. Run the Set footnote prefix command and enter a prefix, e.g. 2- for chapter 2 (this saves a footnote-prefix property in the note).
  2. From then on, the numbered command inserts [^2-1], [^2-2], … and the named command starts new references with the prefix ([^2-]) filled in.
  3. The linter understands prefixes too: it renumbers [^2-x] footnotes within their own namespace, and can also convert a note's existing plain footnotes to carry the prefix (Apply the note's footnote prefix, on by default).

Notes without the property keep normal [^1], [^2], … numbering. A prefix follows the same rules as a footnote name and can't end in a digit, as then [^2-1] and [^21] would be indistinguishable.

Per-note prefix: set it once, then numbered and named footnotes carry it

Other settings

  • Insert footnote reference at end of word (on by default): pressing the hotkey mid-word places the reference at the end of the word, past any closing quotation marks, brackets, or emphasis and the punctuation after them, so you don't have to aim.
  • Expand selections to whole words (on by default): the selection twin of the above; a selection converted into a footnote grows to whole words first.
  • Enable section heading (off by default): automatically adds a heading (e.g. # Footnotes) above your footnote definitions. The heading text is fully customizable, can span multiple lines, and if it already exists in the note it's reused instead of duplicated.
  • Trim blank lines (on by default): removes stray blank lines from the end of the note when the first footnote is added.

More info

Background

This plugin is based on the great idea by jacob.4ristotle posted in the "Footnote Shortcut" thread:

Use case or problem:

I use Obsidian to take school notes, write essays and so on, and I find myself needing to add frequent footnotes. Currently, to add a new footnote, I need to:

  • scroll to the bottom to check how many footnotes I already have
  • type [^n] in the body of the note, where n is the next number
  • move to the end of the note, type [^n] again, and then add my citation.

Created by Alexis Rondeau and Micha Brugger, maintained and expanded by Jason Qin.

For developers

  • Build: npm install, then npm run build (type-checks with tsc and bundles with esbuild). npm run dev watches for changes.
  • Tests: npm test runs the Vitest unit suite in test/; behavioral policies (reindexing rules, reference parsing, edge cases) are pinned there, and the fast-check property tests fuzz both the linter and the insert commands over randomly generated documents, including a differential oracle that re-parses every document with micromark before and after linting. manual-tests/ contains scripted in-app scenarios, and scripts/smoke-test.mjs drives a live Obsidian instance.
  • Static checks: npm run lint (ESLint with the Obsidian plugin guidelines plus typescript-eslint's strict-type-checked) and npm run knip (dead exports and unused files/dependencies, kept at zero findings).
  • Mutation testing: npm run mutation runs Stryker locally as a pre-release audit (incremental cache makes re-runs fast). Not wired into CI on purpose.
  • Architecture: src/main.ts registers commands and settings; the command cascade and creation steps live in src/commands/, the shared markdown scanner and footnote grammar in src/parsing/, editor and caret utilities in src/editor/, and the linter with its pure rules in src/linting/.
  • Contributions welcome. See CONTRIBUTING.md and TESTING.md.

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Auto pair chinese symbol
5 years ago by renmu123
中文符号自动补齐
Backtick text selector
2 years ago by Ram Rachum
Obsidian plugin for selecting text in backticks
Better Command Palette
5 years ago by Alex Bieg
A better command palette for obsidian
Code Blocks commands
a year ago by dragonish
Provide commands to insert code blocks with markup, and support triggering commands with backticks.
Code Editor Shortcuts
5 years ago by Tim Hor
Obsidian plugin to add keyboard shortcuts commonly found in code editors such as Visual Studio Code (vscode) or Sublime Text
Custom Comments
a year ago by Jack Chronicle
Adds a method to create custom methods to enclose comments
Expand Selection
6 months ago by Alex Tait
Obsidian plugin to expand your editor selection to lines, sections (recursive), or the entire note
FastForwardLink
2 years ago by Idan Liberman
FastForwardLink Obsidian.md Plugin
Footlinks
6 years ago by Daha
Obsidian plugin that extracts urls from the main text to footer, offering a better reading/editing experience.
Format Hotkeys
6 years ago by Ansel Santosa
Google Docs style formatting hotkeys for Obsidian
Ghost Text
a year ago by lawrencefeng17
Hanko
2 years ago by Telehakke
Obsidian plugin.
Harpoon
3 years ago by mask(developermask)
Heading Helper
a year ago by Siddhartha Khuntia
Hotkeys for Bookmarks
6 years ago by Vinzent
Hotstrings
2 years ago by wakywayne
Key Promoter
5 years ago by Johannes Theiner
Learn keyboard shortcuts by showing them when using the mouse
Keyboard Analyzer
4 years ago by cogscides
Obsidian plugin to display command hotkeys on a visible keyboard layout
Leader Hotkeys
6 years ago by Tony Grosinger
Use a leader-key (tmux style) for hotkeys in Obsidian.md
Linter
5 years ago by Victor Tao
An Obsidian plugin that formats and styles your notes with a focus on configurability and extensibility.
LLM Shortcut
a year ago by Viktor Chernodub
Obsidian plugin for creating commands powered by LLM capabilities.
Marjdown shortcuts
5 years ago by Jules Guesnon
🪨 Obsidian plugin that allows to write markdown from commands
Math+
4 months ago by ocapraro
This is an Obsidian plugin for taking math notes using Excalidraw.
Next Link
3 years ago by Juan Luque
Note Codes
a year ago by Ezhik
Reference your Obsidian notes from anywhere with simple 4-character codes.
Quick Links
3 years ago by Ian Fisher
Obsidian plugin to create quick link shortcuts
Quick Nav
a year ago by exoticknight
Enhance your editing experience by unleashing the hidden power of shortcuts.
Quickly
3 years ago by Sparsh Yadav
Quick capture to obsidian note
Rich Text Editor Shortcuts
2 years ago by Joshua Wootonn
Create and toggle checkboxes, paste links wrapping your current selection, and toggle underline without leaving the keyboard.
Script Launcher
4 years ago by Alessandro Ruggiero
An Obsidian plugin that allows you to easily run scripts written in any language directly from the app
Sequence Hotkeys
4 years ago by Ruan Moolman
Obsidian plugin to support a sequenced of keyboard shortcuts to run commands.
Shortcuts extender
6 years ago by kitchenrunner
Plugin for Obsidian: Use shortcuts for input special symbols and changing level of headings without language switching
Side-Notes
2 months ago by Fried Fishsticks
Tufte-style sidenotes for Obsidian
Text Expander JS
4 years ago by Jonathan Heard
Obsidian plugin: Type text shortcuts that expand into javascript generated text.
Tidy Footnotes
5 years ago by Charlie Chao
Tidy your footnotes seamlessly in Obsidian.
Vimium
2 years ago by Karsten Finderup Pedersen
Interact with elements using keyboard shortcuts in the spirit of Vim.
Wrap with shortcuts
5 years ago by Manic Chuang
Wrap selected text in custom tags with shortcuts.