feat nvim: add menu
This commit is contained in:
parent
768e879e22
commit
db517f1bcf
@ -0,0 +1,28 @@
|
|||||||
|
return {
|
||||||
|
{ "nvzone/volt" , lazy = true },
|
||||||
|
{
|
||||||
|
"nvzone/menu",
|
||||||
|
dependencies = { "MunifTanjim/nui.nvim" },
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
-- Keyboard users
|
||||||
|
vim.keymap.set("n", "<C-t>", function()
|
||||||
|
require("menu").open("default")
|
||||||
|
end, {})
|
||||||
|
|
||||||
|
-- mouse users + nvimtree users!
|
||||||
|
vim.keymap.set({ "n", "v" }, "<RightMouse>", function()
|
||||||
|
require('menu.utils').delete_old_menus()
|
||||||
|
|
||||||
|
vim.cmd.exec '"normal! \\<RightMouse>"'
|
||||||
|
|
||||||
|
-- clicked buf
|
||||||
|
local buf = vim.api.nvim_win_get_buf(vim.fn.getmousepos().winid)
|
||||||
|
local options = vim.bo[buf].ft == "neo-tree" and "neo-tree" or "default"
|
||||||
|
|
||||||
|
require("menu").open(options, { mouse = true })
|
||||||
|
end, {})
|
||||||
|
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user