Yazi FM

by zulerne
5
4
3
2
1
Score: 50/100

Description

Yazi in your Obsidian vault: Yazi's standard keys and behavior, plus your own keymap.toml and yazi.toml.

Reviews

No reviews yet.

Stats

1
stars
53
downloads
0
forks
5
days
5
days
5
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
28
commits

README file from

Github

Yazi FM

Yazi in your vault: the same default keys and behavior as Yazi, plus your own keymap.toml and yazi.toml. Nothing new to learn.

Yazi FM does not invent its own keymap. It ships Yazi's standard bindings and reads your Yazi config, so the keys you use in the terminal do the same thing in Obsidian: the same chords, the same prepend_keymap overrides, the same plugins (smart-enter, jump-to-char, toggle-pane…). Where Obsidian needs something different, you add it in a separate Obsidian-only keymap instead of changing your terminal setup.

Quick start

  1. Install. Settings → Community plugins → Browse, search for Yazi FM, install and enable it (or open the listing). To install manually, download main.js, manifest.json and styles.css from the latest release into <vault>/.obsidian/plugins/yazi-fm/. Desktop only.
  2. Open it. Click the folder icon in the ribbon or run Yazi FM: Open from the command palette. It opens in the left sidebar.
  3. Use Yazi's keys. j/k move, l enters a folder, h goes up, Enter opens a file, Space selects, y/x/p copy, cut and paste, a creates, r renames, d trashes. Press ~ or F1 for the full list.
  4. Optional. If you use Yazi in the terminal, your ~/.config/yazi/keymap.toml and yazi.toml are read automatically. To use Yazi FM instead of Obsidian's file explorer, turn on Settings → Yazi FM → Replace the file explorer.

Features

  • Yazi's default keymap built in. The Yazi 26.9.1 [mgr] defaults are bundled verbatim. Your keymap.toml is layered on top exactly like Yazi does it: prepend_keymap, keymap and append_keymap. The first binding whose first key matches wins.
  • Reads ~/.config/yazi. The plugin reads keymap.toml and these yazi.toml [mgr] options: ratio, sort_by, sort_sensitive, sort_reverse, sort_dir_first, linemode and show_hidden. You can also paste the configuration into the plugin settings instead.
  • Yazi layout. Parent, current and preview columns; a which-key popup for chords; a status bar; visual mode; selection and yank markers; the mtime/btime/size linemodes.
  • Obsidian-only overrides. An extra keymap in the plugin settings, in the same format, is applied on top of keymap.toml without touching your terminal setup. You can also hide bindings you do not need, and cd bindings to paths outside the vault are hidden automatically.
  • Works with any keyboard layout. By default, Latin keys are read as typed and keys from non-Latin layouts by their QWERTY position, so bindings work without aliases. You can also force physical positions or typed characters.
  • Sidebar or tab. Open the explorer in the left sidebar, the right sidebar or a main tab. The sidebar can use its own column ratio.
  • Vault-aware file operations. Renames and moves go through Obsidian, so links are updated. Deletion follows Obsidian's trash setting.

Usage

Open the explorer with the ribbon icon or one of these commands:

  • Yazi FM: Open
  • Yazi FM: Open in left sidebar
  • Yazi FM: Open in right sidebar
  • Yazi FM: Open in new tab
  • Yazi FM: Reveal active file

Press ~ or F1 inside the explorer to list every active binding.

Run Yazi FM: Reload Yazi config after you edit your Yazi config files.

How Yazi commands map to Obsidian

Yazi command Behaviour in Obsidian
open Opens the file in Obsidian. Files that Obsidian cannot display open in the system default app. open --interactive offers: new tab, split, new window, default app, reveal in Finder.
remove Moves files to trash according to Obsidian's "Deleted files" setting. --permanently deletes them.
cd, reveal Accepts paths relative to the current folder, ~ or / alone (the vault root) and absolute paths inside the vault, including ~/… paths that lead into it.
search --via=fd / --via=rg Searches the current folder recursively by name or by content. No external tools are needed.
shell Desktop only. Runs in the background through /bin/sh in the current folder, with %s (selected files) and %h (hovered file). A command of the form ya emit <cmd> runs <cmd> in the explorer.
plugin smart-enter, jump-to-char, toggle-pane, confirm-quit, smart-filter, fzf, zoxide Built-in equivalents of these Yazi plugins. zoxide jumps to any folder in the vault.
quit Collapses the sidebar or closes the explorer tab.

Not supported: Yazi tabs (tab_create opens another explorer tab instead), link, hardlink, bulk_create, bulk rename, the task manager and shell --block. The settings page lists the bindings from your config that are not available.

Extra commands you can bind:

  • open --tab, open --split and open --window open files in a new tab, split or window;
  • copy vault_path copies the path relative to the vault;
  • copy wikilink copies a link to the file;
  • obsidian <command-id> runs any Obsidian command.
[[mgr.prepend_keymap]]
on = ["c", "l"]
run = "copy wikilink"
desc = "Copy a link to the file"

Settings

  • Replace the file explorer. Off by default. Shows Yazi FM in place of Obsidian's file explorer in the left sidebar and closes the core file explorer. If Obsidian recreates it, Yazi FM replaces it again. Turn the setting off to bring the core file explorer back.

  • Open the explorer in. Left sidebar, right sidebar or main tab. Used by the ribbon icon and the Open command.

  • Use Iconize icons. On by default. When the Iconize plugin is installed, files and folders show the icons and colors assigned there; otherwise the built-in icons are used.

  • Hide excluded files. Off by default. Files and folders listed in Obsidian's Settings → Files and links → Excluded files are treated like dot files: hidden until you show hidden files with ..

  • Markdown preview. Rendered (default) or the note's source text in the preview column.

  • Start at the active file. On by default. When the explorer opens, it goes to the folder of the active note and hovers it.

  • Sidebar column ratio. The parent, current and preview column widths used in a sidebar. The default is 0,1,0. Leave it empty to use ratio from yazi.toml.

  • Open files in. The last active editor tab or a new tab. You can also choose whether keyboard focus moves to the opened file.

  • Collapse the sidebar after opening a file. Off by default. When the explorer is in a sidebar, that sidebar is hidden once a file opens in Obsidian, and the opened file gets focus.

  • Keyboard layout. Auto (default), Physical or Typed. Auto reads Latin keys as typed and keys from non-Latin layouts by their QWERTY position. Physical always uses the QWERTY position, which also works for punctuation in non-Latin layouts. Typed always uses the character your layout produces. The character after jump-to-char is always read as typed, so you can jump to files with non-Latin names.

  • Configuration source. Read the configuration from the Yazi config folder (~/.config/yazi by default), or paste keymap.toml and yazi.toml into the settings.

  • Obsidian-only keymap. Uses the same format as keymap.toml and is applied on top of it, only in Obsidian. For example, this opens files in a new tab with t, since Yazi tabs do not exist here:

    [[mgr.prepend_keymap]]
    on = "t"
    run = "open --tab"
    desc = "Open in a new tab"
    
  • Hide paths outside the vault. On by default. Drops cd and reveal bindings whose path is outside the vault, such as Yazi's g d → ~/Downloads.

  • Ignored keys. Key sequences to drop from your keymap in Obsidian, separated by commas, for example g t, g f, w (Yazi's trash, follow-symlink and task-manager keys, which do nothing in Obsidian).

The bottom of the settings page lists how many bindings are loaded, which are hidden and which are not available in Obsidian.

Development

npm install
npm run dev            # watch build
npm run build          # type-check and production build
OBSIDIAN_VAULT=/path/to/vault npm run install-vault

To release, run npm version <patch|minor|major> and push the tag. GitHub Actions builds the plugin and attaches main.js, manifest.json and styles.css to the release.

Credits

Key notation, default bindings and behaviour follow Yazi by sxyazi. This plugin is not affiliated with the Yazi project.

License

MIT