From 3352b3b6e69df8dbd2f5c37663356836abc9cfdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 8 Jul 2025 22:24:18 +0200 Subject: [PATCH] nvim: move out fugitive bindings --- .config/nvim/lua/maps.lua | 18 ------------------ .config/nvim/plugin/fugitive.lua | 13 +++++++++++++ 2 files changed, 13 insertions(+), 18 deletions(-) create mode 100644 .config/nvim/plugin/fugitive.lua 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, +})