nvimconfig/after/plugin/lspsaga.lua
Robert Morrison 26d5e3b1ce
lspsaga config
I'm still not fully sold on this plugin yet.
There are some little issues that I might be able to fix.
2022-07-15 06:51:55 +01:00

42 lines
1002 B
Lua

local ok, saga = pcall(require,"lspsaga")
if not ok then
return
end
-- winbar is currently in nightly so this is wrapped for safety
if vim.fn.exists('+winbar') ~= 0 then
saga.init_lsp_saga({
symbol_in_winbar = {
in_custom = false,
enable = true,
seperator = '', -- might swap with 
show_file = true,
click_support = false
}
})
else
saga.init_lsp_saga()
end
-- Here we map keys since it makes sense to do it here
local action = require("lspsaga.codeaction")
vim.keymap.set("n","<leader>lca",action.code_action,{silent = true,noremap = true})
vim.keymap.set("n","<leader>lca",function ()
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<C-U>",true,false,true))
action.range_code_action()
end, {silent = true, noremap = true})
--local gr = vim.api.nvim_create_augroup("LspSaga_Hover",{clear = true})
--vim.api.nvim_create_autocmd("CursorHold",{
--pattern = {"*"},
--callback = function ()
--require("lspsaga.hover").render_hover_doc()
--end,
--group = gr
--}
--)