Footnote Shortcut

approved

by Alexis Rondeau, Micha Brugger

Forked from akaalias/obsidian-footnotes

Makes creating footnotes more fun!

162 stars140,846 downloadsUpdated 2y ago
View on GitHub

Obsidian Footnotes Plugin

Obsidian Downloads Active Development Release Version

This hotkey lets you:

  • Insert a new numbered footnote marker (e.g. [^1]) with auto-incremented index in your text
  • Insert a new named footnote marker (e.g. [^Citation]) in your text
  • Adds the corresponding footnote detail (e.g. [^1]: or [^Citation]: ) at the bottom of your text
  • Places your cursor so you can fill in the details quickly
  • Jump from your footnote TO the footnote detail
  • Jump from your footnote detail BACK to the footnote

Overview

IMPORTANT: You must to set up your footnote hotkeys

After installing and activating this plugin, you still have to SET UP your hotkeys. This is easy and quick:

Settings -> Hotkeys -> Search for "Footnote" -> Customize Command -> Your preferred hotkeys

I personally use:

  • Alt+0 as my auto-numbered footnote hotkey
  • Alt+- as my named footnote hotkey

Hotkey

If you would like, you can further customize the plugin's behavior in Footnote Shortcut Settings.

Feature Details

Numbered Footnotes

Scenario: No previous numbered (e.g. "[^1]") footnotes exist:

  • Given my cursor is where I want a numbered footnote to exist (e.g. Foo bar baz▊)
  • When I hit auto-numbered footnote hotkey
  • Then a new footnote marker (e.g. [^1]) is inserted where my cursor was (e.g. Foo bar baz[^1])
  • And a new footnote details marker (e.g. [^1]: ) is inserted on the last line of the document
  • And my cursor is now placed at the end of the detail marker (e.g. [^1]: ▊)

Scenario: Previous numbered (e.g. "[^1]") footnotes exist:

  • Given there is one or more numbered footnotes in my text
  • And my cursor is where I want a numbered footnote to exist (e.g. Foo bar[^1] baz▊)
  • When I hit auto-numbered footnote hotkey
  • Then a new footnote marker with the next numbered index (e.g. [^2]) is inserted where my cursor was (e.g. Foo bar[^1] baz[^2])
  • And a new footnote details marker (e.g. [^2]: ) is inserted on the last line of the document
  • And my cursor is now placed at the end of the detail marker (e.g. [^2]: ▊)

Named Footnotes

Scenario: Add a named footnote:

  • Given my cursor is where I want a named footnote to exist (e.g. Foo bar baz▊)
  • When I hit named footnote hotkey
  • Then an empty footnote marker (e.g. [^]) is inserted around my cursor (e.g. Foo bar baz[^▊])
  • Then, I fill in the name I want (e.g. Foo bar baz[^customName])
  • When I hit named footnote hotkey again
  • A matching footnote details marker (e.g. [^customName]: ) is inserted on the last line of the document
  • And my cursor is now placed at the end of the detail marker (e.g. [^customName]: ▊)

Universal

Footnote Autosuggest

  • automatically suggests similar footnotes to save you time when typing repeated footnotes

ezgif com-video-to-gif (1)

Footnote Section Heading

  • automatically adds a customizable heading separating your footnotes from the rest of your note
  • disabled by default

ezgif com-video-to-gif

Scenario: Jumping TO a footnote detail

  • Given I'm on a footnote detail line (e.g. [^1]: ▊)
  • When I hit auto-numbered footnote hotkey OR named footnote hotkey
  • Then my cursor is placed right after the first occurence of this footnote in my text (e.g. [^1]▊)

Scenario: Jumping BACK to a footnote

  • Given I'm on - or next to - a footnote (e.g. [^1]▊) in my text
  • When I hit auto-numbered footnote hotkey OR named footnote hotkey
  • Then my cursor is placed to the right of the footnote (e.g. [^1]: ▊)

More Info

Other Recommended Plugins

  • If you're looking for the capability to "Automatically Re-Index Footnotes", check out the Linter plugin, which has the ability to re-index all your footnotes based on order of occurrence every time a note is changed or saved.

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.

Proposed solution:

It would be convenient to have a shortcut to automate these steps. In particular, I envision that the shortcut would: Using the smallest natural number n that has not yet been used for a footnote

  • add [^n] at the insertion point
  • add [^n]: to the end of the note, and move the insertion point there.

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.