Reveal Active File Button

approved

by claremacrae

Add a button to the top of the File Explorer, to reveal the active file.

67 stars17,021 downloadsUpdated 20d agoMIT

"Reveal Active File Button" Obsidian Plugin

Contents

Purpose

Reveal Active File Button is an Obsidian plugin that adds a single-click button to make the Obsidian.md File Explorer/Navigator show your active file, for example to find neighbouring files.

This is a convenient addition to these built-in options already included in Obsidian:

  • The command "File explorer: Reveal active file in navigation"
  • The pane menu option "Reveal file in navigation"

Usage

To scroll Obsidian File Explorer/Navigator show your active file, click on the crosshairs icon:

RevealActiveFile

The result:

ActiveFileRevealed

Tips

If scroll position isn't quite correct

  • If the File Explorer/Navigator does not quite scroll to the correct position, click the button a second time and it will work.
    • Explanation: the button simply invokes the built-in Obsidian command "File explorer: Reveal active file in navigation".
    • In large vaults, or for a file in a folder with a large number of files, the command does not always move to the correct position the first time.
    • A second request appears to work reliably.

If you tested version 1.0.0

If you are one of a few people that tested this plugin before it was added to the list of Community Plugins, you should remove that old version, as the plugin has been renamed.

For help with doing that, see Removing version 1.0.0.

Changelog

See Changelog.

Development

Doing a release

Instructions based on https://docs.obsidian.md/Plugins/Releasing/Release+your+plugin+with+GitHub+Actions

  1. Check that the Verify Commit action succeeded.

  2. Makes sure you are on main.

  3. Set the new version number in package.json's version variable.

  4. Set the Obsidian minAppVersion variable in manifest.json.

  5. Run npm run version

  6. Commit and push all changes

  7. Check that the Verify Commit action succeeded.

  8. Run the following, replacing 2.0.4 with the new version number.

    git tag -a 2.0.4 -m "2.0.4"
    git push origin 2.0.4
    
  9. Browse to the Actions tab. The workflow might still be running, or it might have finished already.

  10. When the workflow finishes, browse to the Releases tab in the sidebar on the right side. The workflow has created a draft GitHub release and uploaded the required assets as binary attachments.

  11. Select Edit (pencil icon) on the right side of the release name.

  12. Add release notes to let users know what happened in this release, and then select Publish release.

Related Plugins

  • Collapse All
    • This plugin collapses and expands the file explorer
    • It is compatible with this plugin: both can be installed, and are useful alongside each other, as shown in this image:
      collapse-all-and-reveal-active
  • Automatically Reveal Active File
    • Use this if you always want the navigator to show the active file
    • And you don't mind Obsidian jumping away from other views, like Search results or the Tags panel

Thanks

  • This code is heavily based on Nathan Smith's Collapse All plugin, with thanks.

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.