pjeby / quick-explorer

Perform file explorer operations (and see your current file path) from the Obsidian.md title bar
ISC License
270 stars 13 forks source link
obsidian-md obsidian-plugin

Quick Explorer for Obsidian

New in 0.2.11: Vim-style navigation hotkeys: Mod+h/j/k/l (Mod=Cmd on Mac, Ctrl on PC) New in 0.2.0: If you're using Obsidian 0.16.3 and have tab titlebars turned on, Quick Explorer can use them in addition to (or in place of) the main title bar or status bar. If you want to hide QE's default breadcrumbs, you can turn them off using the Style Settings plugin.

Obsidian's in-app file explorer is pretty flexible, but it's almost 100% mouse-driven and not at all keyboard-friendly. Worse, if you have a lot of folders with lots of files in them, you can spend a lot of time expanding and collapsing folders, and scrolling around to find what you're looking for. This can be especially annoying when all you want is to do something with the "current" folder, or a parent of it... without needing to open a sidebar and close it again afterwards. (And last, but not least, trying to rapidly preview the contents of a lot of notes with the mouse is a giant PITA.)

Enter Quick Explorer. It's menu-based and keyboard-friendly, stays out of your way when you aren't using it, and makes it super-easy to navigate from either the vault root or current folder, without needing to scroll through or collapse a zillion other folders to find what you're looking for. You can even search by name within a folder, just by typing.

 

 

But wait, there's more: a quick-preview mode that makes previewing lots of notes super easy, with no mousing and no popups overhanging the file list: you can just keep hitting the PgDn key to scroll through the full contents of every note in a folder, as quickly as if they were pages in a notebook, or as scrolling through a single giant document:

 

 

Folder notes are supported, too: previewing a folder shows the folder note without you first needing to navigate into the folder and find the note, and when you do navigate into the folder its folder note will be automatically selected, if present. (A "folder note" is a note whose name is the same as the name of its enclosing folder: other Obsidian plugins such as Note Folder Autorename can be used to help create or maintain them.)

 

And last, but far from least, you can even see the path of the current note file as a "breadcrumbs bar" in each window's title bar (or status bar if the Obsidian title bar is disabled). Each breadcrumb, when clicked, drops down (or pops up) a list of the the files and folders in the same directory. So if you click on the breadcrumb for the current file, you'll see the items in its folder, and the first breadcrumb will show items in the vault root.

No matter where you click, though, you can then do almost anything that can be done with Obsidian's built-in file explorer:

And an extensive set of keyboard operations is available as well:

Like the built-in file explorer, Quick Explorer will either show all files, or only the ones supported by Obsidian, depending upon whether the "Detect all file extensions" setting is enabled in the "Files and Links" options tab.

Quick explorer also includes six hotkeyable commands:

(Note: the "go to" commands navigate using Quick Explorer's menu order, which is to say: folder note first, subfolders second, and files last. Roughly speaking, they're equivalent to issuing the "browse current folder" command and then arrowing up or down (or using Home/End) and hitting enter until a file is opened. So the "first file" is either the folder note (if any) or the first file in any subfolder of the current folder, and the "last file" is either the last actual file, or the last file in any subfolder if the folder only contains a folder note.)

And last, but not least, Quick Explorer also adds a "Show in Quick Explorer" option to all file menus other than its own. That way, you can use it from links, graph views, the Pane Relief history menus, other views (like Stars or Recent Files), etc., so you can use it instead of the File Explorer.

Theme and Plugin Compatibility

While active, Quick Explorer may reformat the title bar so that the standard Obsidian title appears on the right, rather than the center, to make room for Quick Explorer itself. It also removes the name of the current file from the display, but not from the operating system-level window title! This means that if you're using a plugin like Custom Window Title that manipulates the window title directly, it will still be working at the OS level even if the displayed title is shortened, so that automations/scripts/etc. that find the window by its title should still work correctly.

Quick Explorer was initially written using the same color variables as Obsidian itself does for menus. Unfortunately, the vast majority of themes do not set these variables in such a way as to provide adequate contrast for the menu selection in dark mode, and some do not do so in light mode, either. (This is probably because selection contrast in menus isn't terribly important if you have to use the mouse cursor anyway, but it makes keyboard navigation impossible.)

To work around this, Quick Explorer now uses the color variables Obsidian uses to highlight selected mode buttons, which provides adequate contrast on most themes in both dark and light mode, but may be too bright or vivid in some themes. There is unfortunately no easy way to make this perfect for everybody, without basically getting all the theme developers to fix their menu color sets for base Obsidian, at which point Quick Explorer could be changed back to using the same variables as Obsidian does.

Another compatibility issue: some themes attempt to hide or downplay title bar items, making Quick Explorer's UI invisible. Others (or CSS snippets) may color the titlebar in such a way that it becomes unreadable. There is not really anything that Quick Explorer can do to fix these issues, so you may need to add your own CSS snippet workarounds or ask your theme's developer to make adjustments.

Current Limitations