denvolok4k downloadsSmoothly navigate the native File Explorer using keyboard only (Vim-like).
Obsidian plugin to enable keyboard based workflow(Vim-like) in the native File Explorer.
For Vim users, Obsidian currently supports using Vim-mode in the Editor (enabled in Settings), but not in other tool
windows, like File Explorer.
The goal of this plugin is to fill this gap for users who rely on a keyboard-based workflow.
Refer to the BRAT documentation for detailed instructions.
main.js, manifest.json, styles.css) from
the releases pageVAULT_DIR/.obsidian/plugins/sidebar-keyboard-navigationFiles: Show file explorer: focus the File Explorer (e.g. Alt+P)Toggle left sidebar: toggle the File Explorer (e.g. Alt+Shift+P)Files: Reveal current file in navigation: (e.g. Alt+F1, similar to one in Intellij IDEA)Focus on tab group to the right/lef/below/above: to switch between opened splits (e.g.
Ctrl- L/H/J/K). You can also use Esc to switch from the File Explorer to the most recent Split.Files: Show file explorer or File: Reveal current file in navigation command (
shortcut or from the Command Palette).j/k/h/k/n/f, and introduce more
advanced actions gradually.If, after some operation (e.g. after deleting a note via default mapping -
Ctrl-Shift-D), you see that no nodes focused(focus lost) - just pressjorkto get focus back.
When you open the Search toolbar, the keyboard focus initially placed on the input element.
After you entered the search term, you can unfocus the search input by pressing Tab, and then start navigating by
moving focus to the first entry (j).
After you open a file from the search results (by pressing l or Enter), you can quickly move focus back to the same
position in the search results by pressing Shift + Tab.
It's the native app's behavior and will work only if you have a single editor opened (no splits).
[!NOTE]
- All key bindings currently limited to use only a single key press, and
Ctrl/Altmodifiers are not used, as these > are likely to interfere with the native key bindings.
- Node - an entry in a sidebar toolbar (file or folder for File Explorer)
- Focused node - a node with the cursor(focus) positioned on it
- Selected node - a node selected via selection
- Background-opening - opening a file without switching focus to the Editor
- Mappings for some destructive actions (e.g. delete note/folder) are disabled by default in Settings, so you don't accidentally damage your precious stuff while exploring the plugin for the first time.
| Key | Action | Description |
|---|---|---|
| Base Movements | ||
j |
move down | Also works for context menu |
J |
move down, and if a file focused - background-open focused file | Native: Ctrl + ArrowDown.Can be used to quickly preview files in a folder |
k |
move up | Also works for context menu |
K |
move up, and if a file focused - background-open focused file | Native: Ctrl + ArrowUp.Can be used to quickly preview files in a folder |
g |
focus the topmost root node | |
G |
focus the bottommost root node | |
v |
toggle selection on focused node | |
V |
clear selection (deselect all nodes) | |
| Folds | ||
h |
a) if an opened folder or a file focused - close the current folder b) if a closed folder focused - jump to the parent folder |
|
H |
a) if an opened folder focused - close it recursively b) if a closed folder, or a file focused - jump to the parent folder |
|
l |
a) if a folder focused - open it b) if a file focused - open it in the recently active Editor |
|
L |
a) if a folder focused - expand it recursively b) if a file focused - open it, but keep focus on File Explorer |
|
Z |
close all folders recursively | |
| Opening Files | ||
t |
open focused file in a new tab | Native: Ctrl + Enter |
T |
background-open focused file in a new tab | |
s |
open focused file in a new vertical split | Native: Open to the right |
S |
background-open focused file in a new vertical split | |
i |
open focused file in a new horizontal split | |
I |
background-open focused file in a new horizontal split | |
w |
open selected files (or focused file) in a new window | |
o |
show popup preview for the focused file | Native: Ctrl + MouseOver.This action is still work-in-progress. Currently, the action doesn't provide auto-hiding for the popup, so you should hide it manually by pressing o again, while focused the same node.Alternatively, you can just mouse-click/mouse-move outside of the popup to hide it. |
| Editing | ||
n |
create a new note inside the current/focused folder | If a folder is focused, this action will create new note in that folder |
N |
create a new note inside the parent folder | If a folder is focused, this action will create new note in the parent folder |
f |
create a new folder inside the current/focused folder | |
F |
create a new folder inside the parent folder | |
r |
rename focused node | Native: Rename (context menu) |
c |
clone focused node | Native: Make a copy (context menu).Min app version required - 1.8.7 |
D |
a) if some nodes selected - delete selected nodes b) otherwise - delete focused node |
Native: Delete (shortcut) |
| Misc | ||
? |
toggle help menu | |
; |
toggle context menu for focused(or selected) node(s) | If you want to invoke context menu for selected nodes - the focus should be on some of selected nodes |
/ |
search in the focused folder | Native: Search in folder (context menu).Changes to the native behavior: deselect search text after opening search window, so user can start typing search term immediately. Min app version required - 1.7.2 |
| Key | Action | Description |
|---|---|---|
| Base Movements | ||
j |
move down | Also works for context menu |
J |
move down, and if a file focused - background-open focused entry | |
k |
move up | Also works for context menu |
K |
move up, and if a file focused - background-open focused entry | |
g |
focus the topmost root node | |
G |
focus the bottommost root node | |
| Folds | ||
h |
collapse current group | |
l |
expand current group, or open focused entry | |
L |
expand current group, or background-open focused entry | |
Z |
Toggle(expand/collapse) all folds | |
| Opening Files | ||
t |
open focused entry in a new tab | |
T |
background-open focused entry in a new tab | |
s |
open focused entry in a new vertical split | |
S |
background-open focused entry in a new vertical split | |
i |
open focused entry in a new horizontal split | |
I |
background-open focused entry in a new horizontal split | |
| Misc | ||
? |
toggle help menu | |
; |
toggle context menu for focused(or selected) node(s) |
When one of supported leafs (tool windows) (e.g. File Explorer) is focused, the plugin is starting listening for
keydown events to invoke appropriate actions.
To implement actions logic, where possible, the plugin tries to use the most abstract native(obsidian/browser)
functions (e.g.
onKeyArrowDown, setFocusedItem) to minimize any conflicts/bugs.
For some actions, it's necessary to mimic the logic from internal functions and apply some changes.
APIs used by the plugin:
getMostRecentLeaf, crate leaf, tree.setFocusedItemNo runtime dependencies.
handleCut/handleCopy/handlePaste)
seems to not be so safe for
edit-actions.TEscapeArrowDown/ArrowUp/Page Down/Page Up) will not work until you
click on Editor, or enter the source modeI prefer to host my open-source projects on Codeberg, but in order to publish the plugin to the community store it has to be hosted on GitHub.
If you prefer to contribute on Codeberg – you can find the mirror repository here.
If you are sure that you have found a bug -
please open an issue.
For any clarifications regarding plugin's functionality, please ask
questions on the forum.
Please leave any feedback in the plugin's topic on the Obsidian official forum.