refactor nvim: 將menu.lua移到ui資料夾
ui資料夾規劃為即使關閉,也不影響主功能使用用途。components資料夾則是重要用途,若關閉將會影響主要必定會用到的功能。
This commit is contained in:
32
dot_config/nvim/exact_lua/exact_plugins/exact_ui/menu.lua
Normal file
32
dot_config/nvim/exact_lua/exact_plugins/exact_ui/menu.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
-- if true then return {} end
|
||||
return {
|
||||
{ "nvzone/volt" , lazy = true },
|
||||
{
|
||||
"nvzone/menu",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-neo-tree/neo-tree.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,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user