mirror of
https://github.com/marianozunino/nvim.git
synced 2025-06-28 18:43:50 -03:00
chore: some qol crap
This commit is contained in:
parent
867159343a
commit
6fb744cdae
34 changed files with 433 additions and 598 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue