diff --git a/README.md b/README.md index dd47b12..f1a25b7 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/lua/fm-nvim.lua b/lua/fm-nvim.lua index 4b5a183..9ec6e00 100644 --- a/lua/fm-nvim.lua +++ b/lua/fm-nvim.lua @@ -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 = "", @@ -289,5 +290,13 @@ function M.TaskWarriorTUI() createSplit(config.cmds.taskwarrior_cmd, "") 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, "") + elseif config.ui.default == "split" then + createSplit(config.cmds.yazi_cmd .. " --chooser-file /tmp/fm-nvim " .. dir, "") + end +end return M diff --git a/plugin/fm-nvim.lua b/plugin/fm-nvim.lua index f278813..f523a6a 100644 --- a/plugin/fm-nvim.lua +++ b/plugin/fm-nvim.lua @@ -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