37 lines
859 B
Lua
37 lines
859 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({
|
|
-- diagnostic sign
|
|
diagnostic_header = { " ", " ", " ", "ﴞ " },
|
|
})
|
|
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("v", "<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 })
|
|
|
|
|
|
|