diff --git a/.config/nvim/lua/maps.lua b/.config/nvim/lua/maps.lua index 2a4fab7e..8caccdd3 100644 --- a/.config/nvim/lua/maps.lua +++ b/.config/nvim/lua/maps.lua @@ -51,21 +51,3 @@ vim.keymap.set("n", "", "resize +2") vim.keymap.set("n", "", "resize -2") vim.keymap.set("n", "", "vertical resize -2") vim.keymap.set("n", "", "vertical resize +2") - -------------- --- Plugins -- -------------- --- Fugitive -vim.keymap.set("n", "", ":Git5") -vim.keymap.set("n", "gb", ":Git blame") -vim.keymap.set("n", "gB", ":Git blame --ignore-revs-file=.git-blame-ignore-revs") - -vim.api.nvim_create_autocmd("WinClosed", { - group = vim.api.nvim_create_augroup("conf_fugitive_prevwin", {}), - callback = function(args) - local win = tonumber(args.match) - if win == vim.api.nvim_get_current_win() and vim.bo.filetype == "fugitive" then - vim.cmd.wincmd("p") - end - end, -}) diff --git a/.config/nvim/plugin/fugitive.lua b/.config/nvim/plugin/fugitive.lua new file mode 100644 index 00000000..6ff0646b --- /dev/null +++ b/.config/nvim/plugin/fugitive.lua @@ -0,0 +1,13 @@ +vim.keymap.set("n", "", ":Git5") +vim.keymap.set("n", "gb", ":Git blame") +vim.keymap.set("n", "gB", ":Git blame --ignore-revs-file=.git-blame-ignore-revs") + +vim.api.nvim_create_autocmd("WinClosed", { + group = vim.api.nvim_create_augroup("conf_fugitive_prevwin", {}), + callback = function(args) + local win = tonumber(args.match) + if win == vim.api.nvim_get_current_win() and vim.bo.filetype == "fugitive" then + vim.cmd.wincmd("p") + end + end, +})