add menu and lazygit

This commit is contained in:
dedal.qq 2024-11-20 02:14:18 +03:00
parent d9272a2cfe
commit 9b6cac6a82
4 changed files with 64 additions and 0 deletions

View File

@ -8,5 +8,16 @@ map("n", "<leader>g", ":Neotree git_status float<CR>", { desc = "open gis status
map("n", "<leader>ff", ":Telescope live_grep<CR>", { desc = "telescope live grep" }) map("n", "<leader>ff", ":Telescope live_grep<CR>", { desc = "telescope live grep" })
map("n", "<leader>r", ":Telescope lsp_references<CR>", { desc = "telescope lsp references" }) map("n", "<leader>r", ":Telescope lsp_references<CR>", { desc = "telescope lsp references" })
-- barbar
map("n", "<tab>", ":BufferNext<CR>", { desc = "Next tab" }) map("n", "<tab>", ":BufferNext<CR>", { desc = "Next tab" })
map("n", "<S-tab>", ":BufferPrevious<CR>", { desc = "Previous tab" }) map("n", "<S-tab>", ":BufferPrevious<CR>", { desc = "Previous tab" })
-- menu
local menu = require("menu")
map("n", "<A-CR>", function()
local ft = vim.bo.ft
if ft ~= "neo-tree" then
menu.open(require("config.menu"), { border = true })
end
end)

25
lua/config/menu.lua Normal file
View File

@ -0,0 +1,25 @@
local gitsigns = require("gitsigns")
return {
{
name = " Preview change",
cmd = gitsigns.preview_hunk,
-- rtxt = "",
},
{
name = "󰗨 Rest change",
cmd = gitsigns.reset_hunk,
-- rtxt = "",
},
{
name = " Toggle blame",
cmd = gitsigns.toggle_current_line_blame,
},
{
name = "󰚃 Toggle delete",
cmd = gitsigns.toggle_deleted,
},
}

20
lua/plugins/lazygit.lua Normal file
View File

@ -0,0 +1,20 @@
return {
"kdheepak/lazygit.nvim",
lazy = true,
cmd = {
"LazyGit",
"LazyGitConfig",
"LazyGitCurrentFile",
"LazyGitFilter",
"LazyGitFilterCurrentFile",
},
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
},
-- setting the keybinding for LazyGit with 'keys' is recommended in
-- order to load the plugin when the command is run for the first time
keys = {
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" },
},
}

8
lua/plugins/menu.lua Normal file
View File

@ -0,0 +1,8 @@
return {
"nvzone/menu",
lazy = true,
config = function() end,
dependencies = {
{ "nvzone/volt", lazy = true },
},
}