[neovim] Fix the LSPSaga/fugitive conflict

This mostly fixes the issue of the mismatch between fugitive's blame
window and LSPSaga's breadcrumbs.
This commit is contained in:
Adam Cooper 2024-01-06 01:34:43 -05:00
parent 945556897f
commit a978993d21

View file

@ -68,6 +68,7 @@ vim.keymap.set(
function ()
-- This restores the UI to the saved layout 'idelayout' (if saved on command line)
-- TODO: Wrap the function body in an if statement to verify existence of idelayout
-- (This depends on command line commands' being executed before this $VIMRC is loaded
vim.cmd("exec idelayout")
end,
{ desc = "Revert window layout" }
@ -105,9 +106,9 @@ require("lazy").setup({
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end
},
{
@ -315,8 +316,7 @@ require('mason').setup()
require('mason-lspconfig').setup()
--[[ lualine
Lualine provides the status bar as well as the tabline. Not sure whether
it also provides the buffer breadcrumbs.
Lualine provides the status bar as well as the tabline.
--]]
require('lualine').setup {
options = { theme = 'dracula' },
@ -618,6 +618,24 @@ end
vim.cmd("highlight GitSignsCurrentLineBlame gui=bold guifg=#339944")
vim.cmd("highlight NonText gui=bold guifg=#999999")
--[[
Resolve conflict between fugitive and LSPSaga, wherein the latter's
breadcrumbs cause a mismatch between the buffer and fugitive's :Git blame
window. To kill the winbar (the top line where the breadcrumbs and this
blame title live), enter `:set winbar&`.
--]]
local group = vim.api.nvim_create_augroup("fugitiveSagaConflict", { clear = true })
vim.api.nvim_create_autocmd(
'FileType',
{
group = group,
pattern = 'fugitiveblame',
callback = function()
vim.api.nvim_set_option_value('winbar', 'fugitive: :Git blame', { scope = 'local' })
end,
}
)
-- Switch syntax highlighting on
vim.cmd("syntax enable")