diff --git a/hosts/shared/programs/editor/nvim/lua/config/keymaps.lua b/hosts/shared/programs/editor/nvim/lua/config/keymaps.lua index 4e8d077b..88fcf708 100644 --- a/hosts/shared/programs/editor/nvim/lua/config/keymaps.lua +++ b/hosts/shared/programs/editor/nvim/lua/config/keymaps.lua @@ -50,11 +50,3 @@ vim.keymap.set("i", "f", "", { noremap = true }) -- Insert mode specific mappings for start/end of line vim.keymap.set("i", "", "", { noremap = true }) vim.keymap.set("i", "", "", { noremap = true }) - --- Yazi -vim.keymap.set("n", "ee", function() - vim.cmd("terminal yazi " .. vim.fn.expand("%:p:h")) - vim.cmd("startinsert") - -- Autocmd to close the terminal when yazi exits - vim.cmd("autocmd TermClose * if &buftype == 'terminal' && expand('') =~ 'yazi' | bd! | endif") -end, { desc = "open yazi in terminal" }) diff --git a/hosts/shared/programs/editor/nvim/lua/plugins/yazi.lua b/hosts/shared/programs/editor/nvim/lua/plugins/yazi.lua new file mode 100644 index 00000000..f61f00d6 --- /dev/null +++ b/hosts/shared/programs/editor/nvim/lua/plugins/yazi.lua @@ -0,0 +1,24 @@ +return { + "mikavilpas/yazi.nvim", + lazy = true, + keys = { + { + -- Open in the current working directory + "ee", + "Yazi cwd", + desc = "Open the file manager in nvim's working directory", + }, + { + "", + "Yazi toggle", + desc = "Resume the last yazi session", + }, + }, + opts = { + -- if you want to open yazi instead of netrw, see below for more info + open_for_directories = false, + keymaps = { + show_help = "", + }, + }, +}