chore: some qol crap

This commit is contained in:
Mariano Z. 2025-04-02 18:07:53 -03:00
parent 867159343a
commit 6fb744cdae
Signed by: marianozunino
GPG key ID: 4C73BAD25156DACE
34 changed files with 433 additions and 598 deletions

View file

@ -24,13 +24,13 @@ local M = {
callback = function()
nmap("P", function()
local cmd = "git push --force-with-lease"
vim.notify("Pushing...", vim.log.levels.INFO)
Snacks.notifier.notify("Pushing...", vim.log.levels.INFO)
vim.fn.jobstart(cmd, {
on_exit = function(_, code)
if code == 0 then
vim.notify("Push completed successfully", vim.log.levels.INFO)
Snacks.notifier.notify("Push completed successfully", vim.log.levels.INFO)
else
vim.notify("Push failed with exit code: " .. code, vim.log.levels.ERROR)
Snacks.notifier.notify("Push failed with exit code: " .. code, vim.log.levels.ERROR)
end
end,
detach = true,
@ -41,6 +41,22 @@ local M = {
local win_id = vim.api.nvim_get_current_win()
vim.api.nvim_win_close(win_id, false)
end, { buffer = true, desc = "Close window" })
-- Git Pull
nmap("gp", function()
local cmd = "git pull"
Snacks.notifier.notify("Pulling...", vim.log.levels.INFO)
vim.fn.jobstart(cmd, {
on_exit = function(_, code)
if code == 0 then
Snacks.notifier.notify("Pull completed successfully", vim.log.levels.INFO)
else
Snacks.notifier.notify("Pull failed with exit code: " .. code, vim.log.levels.ERROR)
end
end,
detach = true,
})
end, { buffer = true, desc = "Close window" })
end,
})
end,