Skip to content

Commit

Permalink
chore: replace yazi keymap with plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ojsef39 committed Nov 11, 2024
1 parent 30d8095 commit b0e1f8d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
8 changes: 0 additions & 8 deletions hosts/shared/programs/editor/nvim/lua/config/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,3 @@ vim.keymap.set("i", "<ESC>f", "<C-Right>", { noremap = true })
-- Insert mode specific mappings for start/end of line
vim.keymap.set("i", "<C-a>", "<Home>", { noremap = true })
vim.keymap.set("i", "<C-e>", "<End>", { noremap = true })

-- Yazi
vim.keymap.set("n", "<leader>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('<afile>') =~ 'yazi' | bd! | endif")
end, { desc = "open yazi in terminal" })
24 changes: 24 additions & 0 deletions hosts/shared/programs/editor/nvim/lua/plugins/yazi.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
return {
"mikavilpas/yazi.nvim",
lazy = true,
keys = {
{
-- Open in the current working directory
"<leader>ee",
"<cmd>Yazi cwd<cr>",
desc = "Open the file manager in nvim's working directory",
},
{
"<c-up>",
"<cmd>Yazi toggle<cr>",
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 = "<f1>",
},
},
}

0 comments on commit b0e1f8d

Please sign in to comment.