Folder Focus

unlisted

by Naoufal Elouahabi

Hide/show folders in the file explorer to keep your focus. Hide all, unhide all, hide specific, keep specific, bulk hide, bulk keep.

Updated 2d agoMIT
View on GitHub

Contributors Forks Stargazers Issues MIT License LinkedIn


Folder Focus

An Obsidian plugin that hides folders in the file explorer so the ones you are working in stay visible.
Explore the source »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Folder Focus is a small Obsidian plugin that hides selected folders from the file explorer. Hiding is presentational only — nothing is moved, renamed or deleted on disk, and unhiding restores the folder immediately.

The plugin registers seven folder-management commands, plus a debug command:

CommandWhat it does
Hide all foldersMarks every folder in the vault as hidden
Unhide all foldersClears the hidden list
Hide specific folderSearchable single-folder picker
Unhide specific folderSearchable picker limited to currently hidden folders
Keep specific folderHides every folder except the one you pick
Bulk hide foldersMulti-select picker with checkboxes
Bulk keep foldersHides everything except the selected folders

There is also a Debug: list all folder paths in console command for inspecting what Obsidian reports as a folder path.

Behaviour you should know about:

  • The hidden list is stored in the plugin's data.json as vault-relative paths.
  • A MutationObserver re-applies the hiding when the file explorer DOM changes — expanding a folder, scrolling, renaming or creating a folder — so hidden folders do not reappear as you navigate.
  • The setting tab lists every hidden folder with an individual Unhide button and an Unhide all button.
  • Unloading the plugin removes every ff-hidden marker and restores the explorer.

(back to top)

Built With

  • Obsidian
  • JavaScript

(back to top)

Getting Started

Prerequisites

  • Obsidian 0.15.0 or newer — the minAppVersion declared in manifest.json.
  • There is no build step. main.js is the shipped plugin file.

Installation

From a release

  1. Download main.js and manifest.json from the latest GitHub release.
  2. Create <vault>/.obsidian/plugins/naoufal-folder-focus/.
  3. Copy both files into that folder.
  4. Reload Obsidian, then enable Folder Focus under Settings → Community plugins.

From source

git clone https://github.com/Elouahabi-Naoufal/obsidian-folder-focus.git
cd obsidian-folder-focus

Copy main.js and manifest.json into <vault>/.obsidian/plugins/naoufal-folder-focus/ and reload Obsidian. src/main.js and main.js are currently identical, so editing either one has the same effect after a reload.

(back to top)

Usage

  1. Open the command palette (Ctrl/Cmd+P).
  2. Run Folder Focus: Hide specific folder and pick a folder from the searchable list.
  3. The folder disappears from the file explorer. Repeat for other folders, or use Bulk hide folders to select several at once.
  4. To restore everything, run Unhide all folders. To restore one folder, run Unhide specific folder or use the Unhide button in Settings → Folder Focus.

A typical workflow is Keep specific folder: run it, pick the course or project you are currently working on, and every other folder is hidden until you clear the list.

(back to top)

Roadmap

Working today:

  • Hide all / unhide all
  • Hide and unhide a single folder through a searchable picker
  • Keep only a selected folder
  • Bulk hide / bulk keep with checkboxes
  • Settings tab listing hidden folders
  • Re-apply hiding after DOM changes, renames and folder creation

Open items visible in the code:

  • Hiding relies on :has() selectors in the file explorer DOM; a future Obsidian UI change could break the selectors, and there is no fallback besides the debug command
  • The settings tab only lists hidden folders; it does not offer a folder picker of its own
  • No automated tests
  • No versions.json, so release/version tooling is manual

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Please test in a throwaway vault: copy the plugin into .obsidian/plugins/naoufal-folder-focus/, reload, and exercise the command you touched. The folder-path matching is the fragile part, so check nested folders and folders with spaces in their names.

Top contributors:

contrib.rocks image

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Naoufal Elouahabi - LinkedIn - elouahabi-naoufal1@gmail.com

Project Link: https://github.com/Elouahabi-Naoufal/obsidian-folder-focus

(back to top)

Acknowledgments

(back to top)

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.