From 1bd6df4840509ad367d42971b8032fee57ad9056 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Fri, 14 Jul 2023 17:49:17 -0500 Subject: [PATCH] refactor(nvim): use autocmd to set neogit settings --- dots/.config/nvim/after/ftplugin/NeogitPopup.lua | 1 - dots/.config/nvim/lua/plugins/configs/neogit.lua | 15 +++++++++++++++ dots/.config/nvim/lua/plugins/plugins.lua | 11 +++-------- 3 files changed, 18 insertions(+), 9 deletions(-) delete mode 100644 dots/.config/nvim/after/ftplugin/NeogitPopup.lua create mode 100644 dots/.config/nvim/lua/plugins/configs/neogit.lua diff --git a/dots/.config/nvim/after/ftplugin/NeogitPopup.lua b/dots/.config/nvim/after/ftplugin/NeogitPopup.lua deleted file mode 100644 index 109e3a4f..00000000 --- a/dots/.config/nvim/after/ftplugin/NeogitPopup.lua +++ /dev/null @@ -1 +0,0 @@ -vim.opt_local.list = false diff --git a/dots/.config/nvim/lua/plugins/configs/neogit.lua b/dots/.config/nvim/lua/plugins/configs/neogit.lua new file mode 100644 index 00000000..c8cf796e --- /dev/null +++ b/dots/.config/nvim/lua/plugins/configs/neogit.lua @@ -0,0 +1,15 @@ +require("neogit").setup({ + disable_insert_on_commit = "auto", + disable_commit_confirmation = true, + use_telescope = true, + integrations = { + diffview = true, + }, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = "*Neogit*", + callback = function () + vim.opt_local.list = false + end +}) diff --git a/dots/.config/nvim/lua/plugins/plugins.lua b/dots/.config/nvim/lua/plugins/plugins.lua index e75f3708..455b40ca 100755 --- a/dots/.config/nvim/lua/plugins/plugins.lua +++ b/dots/.config/nvim/lua/plugins/plugins.lua @@ -468,14 +468,9 @@ lazy.setup({ "NeogitOrg/neogit", dev = true, lazy = true, - opts = { - disable_insert_on_commit = "auto", - disable_commit_confirmation = true, - use_telescope = true, - integrations = { - diffview = true, - }, - }, + config = function() + require("plugins.configs.neogit") + end, dependencies = { { "sindrets/diffview.nvim",