This repository has been archived on 2025-01-07. You can view files and clone it, but cannot push or open issues or pull requests.
opdavies.nvim/after/plugin/fugitive.lua

23 lines
497 B
Lua
Raw Normal View History

vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
vim.api.nvim_create_autocmd("BufWinEnter", {
pattern = "*",
callback = function()
if vim.bo.ft ~= "fugitive" then
return
end
local bufnr = vim.api.nvim_get_current_buf()
local opts = { buffer = bufnr, remap = false }
vim.keymap.set("n", "<leader>p", function()
2023-09-04 10:05:13 +00:00
vim.cmd.Git "push"
end, opts)
vim.keymap.set("n", "<leader>P", function()
2023-09-04 10:05:13 +00:00
vim.cmd.Git { "pull", "--rebase" }
end, opts)
end,
})