refactor(nvim): extract neogit
to its own plugin file
This commit is contained in:
parent
6d913a741c
commit
1214389a57
@ -29,56 +29,6 @@ return {
|
||||
enhanced_diff_hl = true,
|
||||
},
|
||||
},
|
||||
{
|
||||
"neogitorg/neogit",
|
||||
cmd = { "Neogit" },
|
||||
keys = {
|
||||
{ "<leader>g", desc = "> Git" },
|
||||
{ "<leader>gg", "<cmd>Neogit<CR>", desc = "Neogit: Open" },
|
||||
},
|
||||
opts = function()
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "*Neogit*",
|
||||
callback = function()
|
||||
vim.opt_local.list = false
|
||||
vim.opt_local.foldmethod = "manual"
|
||||
end,
|
||||
})
|
||||
|
||||
---@type NeogitConfig
|
||||
return {
|
||||
disable_insert_on_commit = "auto",
|
||||
disable_commit_confirmation = true,
|
||||
disable_builtin_notifications = true,
|
||||
auto_refresh = true,
|
||||
auto_show_console = false,
|
||||
disable_signs = true,
|
||||
preview_buffer = {
|
||||
kind = "split",
|
||||
},
|
||||
filewatcher = {
|
||||
enabled = true,
|
||||
interval = 1000,
|
||||
},
|
||||
graph_style = "unicode",
|
||||
integrations = {
|
||||
diffview = true,
|
||||
telescope = true,
|
||||
},
|
||||
mappings = {
|
||||
popup = {
|
||||
["l"] = false,
|
||||
["L"] = "LogPopup",
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
dependencies = {
|
||||
"sindrets/diffview.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-telescope/telescope.nvim",
|
||||
},
|
||||
},
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
|
58
users/price/dots/.config/nvim/lua/plugins/configs/neogit.lua
Normal file
58
users/price/dots/.config/nvim/lua/plugins/configs/neogit.lua
Normal file
@ -0,0 +1,58 @@
|
||||
return {
|
||||
{
|
||||
"neogitorg/neogit",
|
||||
cmd = { "Neogit" },
|
||||
keys = {
|
||||
{ "<leader>g", desc = "> Git" },
|
||||
{ "<leader>gg", "<cmd>Neogit<CR>", desc = "Neogit: Open" },
|
||||
},
|
||||
config = function()
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "*Neogit*",
|
||||
callback = function()
|
||||
vim.opt_local.foldmethod = "manual"
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "gitcommit",
|
||||
callback = function()
|
||||
vim.api.nvim_win_set_cursor(0, { 1, 0 })
|
||||
vim.cmd.startinsert()
|
||||
end,
|
||||
})
|
||||
|
||||
require("neogit").setup({
|
||||
disable_insert_on_commit = true,
|
||||
disable_commit_confirmation = true,
|
||||
disable_builtin_notifications = true,
|
||||
auto_refresh = true,
|
||||
auto_show_console = false,
|
||||
disable_signs = true,
|
||||
preview_buffer = {
|
||||
kind = "split",
|
||||
},
|
||||
filewatcher = {
|
||||
enabled = true,
|
||||
interval = 1000,
|
||||
},
|
||||
graph_style = "unicode",
|
||||
integrations = {
|
||||
diffview = true,
|
||||
telescope = true,
|
||||
},
|
||||
mappings = {
|
||||
popup = {
|
||||
["l"] = false,
|
||||
["L"] = "LogPopup",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
dependencies = {
|
||||
"sindrets/diffview.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-telescope/telescope.nvim",
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Reference in New Issue
Block a user