Note
this plugin is only guaranteed to be compatible with Yazi nightly
a Yazi plugin that stitches fzf
, fd
, rg
, rga
, bat
, and eza
together
to provide a live search (by name or content) with some preview capabilities
supports: bash
, fish
, and zsh
please note that some dependencies are optional, depending on your usage. see the tables below for an overview of their roles in both search methods
tool | role |
---|---|
bat | file content preview for the 'rg' option |
eza | optional metadata preview for both 'rg' and 'rga' options |
fd | - |
fzf | main interface + optional fzf match for the 'rg' option |
ripgrep | rg search for the 'rg' option |
ripgrep-all | rga search + file content preview for the 'rga' option |
tool | role |
---|---|
bat | file content preview |
eza | directory content preview + optional metadata preview |
fd | fd search |
fzf | main interface + optional fzf match |
ripgrep | - |
ripgrep-all | - |
ya pack -a lpnh/frank
Note
experimental API: i'm still figuring out the best defaults and arguments
if you have suggestions for better defaults and/or arguments, feel free to open an issue or start a discussion — opinions are more than welcome
to avoid ambiguity, this plugin has a two-argument structure, so we can differentiate the search method (by name vs content) and their respective options
for convenience, you can pass only the first argument and let the plugin fall back to a default second argument. this is the "alias" option you'll see below
content
: alias forcontent rg
content rg
: search usingripgrep
content rga
: search usingripgrep-all
name
: alias forname all
name all
: search files and directoriesname cwd
: search files and directories in the current directoryname dir
: search directories onlyname file
: search files only
below is an example of how to configure both searches in the
~/.config/yazi/keymap.toml
file, using only the aliases:
[[manager.prepend_keymap]]
on = ["f", "r"]
run = "plugin frank content"
desc = "Search file by content (rg)"
[[manager.prepend_keymap]]
on = ["f", "d"]
run = "plugin frank name"
desc = "Search by name, files and dirs (fd)"
below is an example how to configure all the available options:
[[manager.prepend_keymap]]
on = ["f", "r"]
run = "plugin frank 'content rg'"
desc = "Search file by content (rg)"
[[manager.prepend_keymap]]
on = ["f", "A"]
run = "plugin frank 'content rga'"
desc = "Search file by content (rga)"
[[manager.prepend_keymap]]
on = ["f", "a"]
run = "plugin frank 'name all'"
desc = "Search by name, files and dirs"
[[manager.prepend_keymap]]
on = ["f", "c"]
run = "plugin frank 'name cwd'"
desc = "Search by name, files and dirs (CWD)"
[[manager.prepend_keymap]]
on = ["f", "d"]
run = "plugin frank 'name dir'"
desc = "Search directory by name"
[[manager.prepend_keymap]]
on = ["f", "f"]
run = "plugin frank 'name file'"
desc = "Search file by name"
this plugin provides the following custom fzf
keybindings:
ctrl-o
: open selected entry with default editor ($EDITOR
)ctrl-r
: reload the searchctrl-s
: togglefzf
match for the current query resultsctrl-]
: toggle the preview window size (66%, 80%)ctrl-\
: toggle the preview window position (top, right)alt-m
: switch the preview to "metadata"alt-c
: switch the preview back to "content" (default)
you can customize the default fzf
colors using the FZF_DEFAULT_OPTS
environment variable. for an example, check out Catppuccin's fzf
repo
more examples of color themes can be found in the fzf documentation
you can customize the colors of eza
previews using its
~/.config/eza/theme.yml
configuration file. check the
eza-theme repository for some
existing themes
for more details, see eza_colors-explanation
for those seeking further customization, you can tweak all the integrated tools
used by this plugin in your ~/.config/yazi/init.lua
file. simply pass a table
to the setup
function with any of the following fields and their respectives
options:
require("frank"):setup({
fzf = "", -- global fzf options
-- content search options
rg = "", -- ripgrep options
rga = "", -- ripgrep-all options
-- name search options
fd = "", -- fd options
-- preview options
bat = "", -- bat options for file preview (rg,fd)
eza = "", -- eza options for directory preview (fd)
eza_meta = "", -- eza metadata options (rg,rga,fd)
rga_preview = "", -- ripgrep-all preview options (rga)
})
all fields are optional and accept either a string or a table of strings containing command-line options
example:
require("frank"):setup {
fzf = [[--info-command='echo -e "$FZF_INFO 💛"' --no-scrollbar]],
rg = "--colors 'line:fg:red' --colors 'match:style:nobold'",
rga = {
"--follow",
"--hidden",
"--no-ignore",
"--glob",
"'!.git'",
"--glob",
"!'.venv'",
"--glob",
"'!node_modules'",
"--glob",
"'!.history'",
"--glob",
"'!.Rproj.user'",
"--glob",
"'!.ipynb_checkpoints'",
},
fd = "--hidden",
bat = "--style 'header,grid'",
eza = "",
eza_meta = "--total-size",
rga_preview = {
"--colors 'line:fg:red'"
.. " --colors 'match:fg:blue'"
.. " --colors 'match:bg:black'"
.. " --colors 'match:style:nobold'",
},
}
almost everything from interface elements to search filters can be customized — you just need to find the right flag