diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 2e17613..b2bbe4c 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -13,6 +13,7 @@ "copilot.vim": { "branch": "release", "commit": "a9fa7946d7307ceb138bfe2706ba75febf6450da" }, "cord.nvim": { "branch": "master", "commit": "40e0a17fc023011b9436d0b3583f874818f3ed3b" }, "csharpls-extended-lsp.nvim": { "branch": "master", "commit": "5a474b06743bb20a90191994457f5e62f444976b" }, + "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, "gitsigns.nvim": { "branch": "main", "commit": "562dc47189ad3c8696dbf460d38603a74d544849" }, "go.nvim": { "branch": "master", "commit": "e66c3240d26936428cd0f320dc5ffa1eb01538b8" }, diff --git a/nvim/lua/themystery/plugins/fugitive.lua b/nvim/lua/themystery/plugins/fugitive.lua deleted file mode 100644 index f96d0ad..0000000 --- a/nvim/lua/themystery/plugins/fugitive.lua +++ /dev/null @@ -1,34 +0,0 @@ -return { - "tpope/vim-fugitive", - config = function() - vim.keymap.set("n", "gs", vim.cmd.Git) - - local TheMystery_Fugitive = vim.api.nvim_create_augroup("TheMystery_Fugitive", {}) - - local autocmd = vim.api.nvim_create_autocmd - autocmd("BufWinEnter", { - group = TheMystery_Fugitive, - 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", "p", function() - vim.cmd.Git('push') - end, opts) - - -- rebase always - vim.keymap.set("n", "P", function() - vim.cmd.Git({ 'pull', '--rebase' }) - end, opts) - - -- NOTE: It allows me to easily set the branch i am pushing and any tracking - -- needed if i did not set the branch up correctly - vim.keymap.set("n", "t", ":Git push -u origin ", opts); - end, - }) - end -} diff --git a/nvim/lua/themystery/plugins/git.lua b/nvim/lua/themystery/plugins/git.lua new file mode 100644 index 0000000..07f6679 --- /dev/null +++ b/nvim/lua/themystery/plugins/git.lua @@ -0,0 +1,50 @@ +return { + { + "tpope/vim-fugitive", + config = function() + vim.keymap.set("n", "gs", vim.cmd.Git) + + local TheMystery_Fugitive = vim.api.nvim_create_augroup("TheMystery_Fugitive", {}) + + local autocmd = vim.api.nvim_create_autocmd + autocmd("BufWinEnter", { + group = TheMystery_Fugitive, + 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", "p", function() + vim.cmd.Git('push') + end, opts) + + -- rebase always + vim.keymap.set("n", "P", function() + vim.cmd.Git({ 'pull', '--rebase' }) + end, opts) + + -- NOTE: It allows me to easily set the branch i am pushing and any tracking + -- needed if i did not set the branch up correctly + vim.keymap.set("n", "t", ":Git push -u origin ", opts); + end, + }) + end + }, + { + "lewis6991/gitsigns.nvim", + config = function() + -- TODOS: Add keybindings + require("gitsigns").setup() + end + }, + { + "sindrets/diffview.nvim", + dependencies = { + "kyazdani42/nvim-web-devicons" + }, + } + +} diff --git a/nvim/lua/themystery/plugins/gitsigns.lua b/nvim/lua/themystery/plugins/gitsigns.lua deleted file mode 100644 index fafec81..0000000 --- a/nvim/lua/themystery/plugins/gitsigns.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "lewis6991/gitsigns.nvim", - config = function() - -- TODOS: Add keybindings - require("gitsigns").setup() - end -} -