Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add yazi file manager support #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- [Twf](https://github.com/wvanlint/twf)
- [Lf](https://github.com/gokcehan/lf)
- [Fm](https://github.com/knipferrc/fm)
- [Yazi](https://github.com/sxyazi/yazi)

</details>

Expand Down
11 changes: 10 additions & 1 deletion lua/fm-nvim.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ local config = {
joshuto_cmd = "joshuto",
lazygit_cmd = "lazygit",
neomutt_cmd = "neomutt",
taskwarrior_cmd = "taskwarrior-tui"
taskwarrior_cmd = "taskwarrior-tui",
yazi_cmd = "yazi"
},
mappings = {
vert_split = "<C-v>",
Expand Down Expand Up @@ -289,5 +290,13 @@ function M.TaskWarriorTUI()
createSplit(config.cmds.taskwarrior_cmd, "<CR>")
end
end
function M.Yazi(dir)
dir = dir or "."
if config.ui.default == "float" then
createWin(config.cmds.yazi_cmd .. " --chooser-file /tmp/fm-nvim " .. dir, "<CR>")
elseif config.ui.default == "split" then
createSplit(config.cmds.yazi_cmd .. " --chooser-file /tmp/fm-nvim " .. dir, "<CR>")
end
end

return M
2 changes: 1 addition & 1 deletion plugin/fm-nvim.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local fileManagers = {"Lf", "Fm", "Nnn", "Fff", "Twf", "Xplr", "Vifm", "Broot", "Gitui", "Ranger", "Joshuto", "Lazygit"}
local fileManagers = {"Lf", "Fm", "Nnn", "Fff", "Twf", "Xplr", "Vifm", "Broot", "Gitui", "Ranger", "Joshuto", "Lazygit", "Yazi"}
local executable = vim.fn.executable

for _, fm in ipairs(fileManagers) do
Expand Down