lazygit: uses snacks.nvim for lazygit

This commit is contained in:
Tigor Hutasuhut 2024-11-07 20:10:13 +07:00
parent ed6114dc05
commit ebac538a83
3 changed files with 46 additions and 32 deletions

View file

@ -84,7 +84,6 @@
"rose-pine": { "branch": "main", "commit": "d396005db5bbd1d4ec7772a7c96c96f4c4802328" }, "rose-pine": { "branch": "main", "commit": "d396005db5bbd1d4ec7772a7c96c96f4c4802328" },
"rustaceanvim": { "branch": "master", "commit": "047f9c9d8cd2861745eb9de6c1570ee0875aa795" }, "rustaceanvim": { "branch": "master", "commit": "047f9c9d8cd2861745eb9de6c1570ee0875aa795" },
"silicon.lua": { "branch": "main", "commit": "f1387c8e2e69743899d6da6d4bd0e42be5ac5fa0" }, "silicon.lua": { "branch": "main", "commit": "f1387c8e2e69743899d6da6d4bd0e42be5ac5fa0" },
"smart-open.nvim": { "branch": "main", "commit": "7770b01ce4d551c143d7ec8589879320796621b9" },
"snipe.nvim": { "branch": "main", "commit": "854a47c970413405361487c13e2b1e9aa9a3696e" }, "snipe.nvim": { "branch": "main", "commit": "854a47c970413405361487c13e2b1e9aa9a3696e" },
"sqlite.lua": { "branch": "master", "commit": "d0ffd703b56d090d213b497ed4eb840495f14a11" }, "sqlite.lua": { "branch": "master", "commit": "d0ffd703b56d090d213b497ed4eb840495f14a11" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },

View file

@ -1,31 +1,31 @@
if vim.env.ZELLIJ ~= nil and not vim.g.neovide then -- if vim.env.ZELLIJ ~= nil and not vim.g.neovide then
-- currently running inside zellij session and not inside neovide -- -- currently running inside zellij session and not inside neovide
vim.keymap.set("n", "<leader>z", function() -- vim.keymap.set("n", "<leader>z", function()
local cwd = vim.fn.expand "%:p:h" -- local cwd = vim.fn.expand "%:p:h"
vim.system { -- vim.system {
"zellij", -- "zellij",
"run", -- "run",
"--close-on-exit", -- "--close-on-exit",
"--cwd", -- "--cwd",
cwd, -- cwd,
"--in-place", -- "--in-place",
"--", -- "--",
"lazygit", -- "lazygit",
} -- }
end, { desc = "Open Lazygit (Zellij)" }) -- end, { desc = "Open Lazygit (Zellij)" })
elseif vim.env.HYPRLAND_INSTANCE_SIGNATURE ~= nil and vim.fn.executable "foot" == 1 then -- elseif vim.env.HYPRLAND_INSTANCE_SIGNATURE ~= nil and vim.fn.executable "foot" == 1 then
vim.keymap.set("n", "<leader>z", function() -- vim.keymap.set("n", "<leader>z", function()
vim.system { -- vim.system {
"hyprctl", -- "hyprctl",
"dispatch", -- "dispatch",
"exec", -- "exec",
"--", -- "--",
"foot", -- "foot",
"--app-id=lazygit", -- "--app-id=lazygit",
"--title=lazygit", -- "--title=lazygit",
"--working-directory=" .. vim.fn.getcwd(), -- "--working-directory=" .. vim.fn.getcwd(),
"--", -- "--",
"lazygit", -- "lazygit",
} -- }
end, { desc = "Open Lazygit (Foot)" }) -- end, { desc = "Open Lazygit (Foot)" })
end -- end

15
lua/plugins/snacks.lua Normal file
View file

@ -0,0 +1,15 @@
return {
"folke/snacks.nvim",
priority = 1000,
lazy = false,
opts = {
bigfile = { enabled = false },
notifier = { enabled = false },
quickfile = { enabled = false },
statuscolumn = { enabled = false },
words = { enabled = false },
},
keys = {
{ "<leader>z", "<cmd>lua Snacks.lazygit()<cr>", desc = "LazyGit" },
},
}