Skip to content
/ fg.yazi Public

yazi plugin for rg or rga search with fzf file preview

License

Notifications You must be signed in to change notification settings

lpnh/fg.yazi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fg.yazi

A Yazi plugin for searching by file content or by filenames using ripgrep or ripgrep-all with fzf preview

Supported shells: bash, fish, nushell, and zsh

Dependencies

Install

# Add the plugin
ya pack -a lpnh/fg

# Install the plugin
ya pack -i

# Upgrade the plugin
ya pack -u

Usage

The following snippets should be included on your ~/.config/yazi/keymap.toml file. Make sure the keys are not used elsewhere.

Search by content using ripgrep

This option uses ripgrep to output all the lines of all files, and then uses fzf to fuzzy matching.

[[manager.prepend_keymap]]
on   = [ "f","g" ]
run  = "plugin fg"
desc = "find file by content (fuzzy match)"

The following option passes the input to ripgrep for a match search, reusing the rg search each time the input is changed. This is useful for searching in large folders due to increased speed, but it does not support fuzzy matching.

[[manager.prepend_keymap]]
on   = [ "f","G" ]
run  = "plugin fg --args='rg'"
desc = "find file by content (ripgrep match)"

Search by content using ripgrep-all

This option uses ripgrep-all to output all the lines of all files, and then uses fzf to fuzzy matching.

[[manager.prepend_keymap]]
on   = [ "f","a" ]
run  = "plugin fg --args='rga'"
desc = "find file by content (ripgrep-all)"

Search by filename with fzf

[[manager.prepend_keymap]]
on   = [ "f","f" ]
run  = "plugin fg --args='fzf'"
desc = "find file by filename"

Tips

You can customize the default colors by using the fzf environment variable, FZF_DEFAULT_OPTS. For an example, check out the Catppuccin's repo.

About

This is a fork of DreamMaoMao's fg.yazi plugin, you can find it at https://gitee.com/DreamMaoMao/fg.yazi

About

yazi plugin for rg or rga search with fzf file preview

Topics

Resources

License

Stars

Watchers

Forks

Languages