mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2025-01-08 09:27:36 +00:00
Update lsp config for lspsaga
This commit is contained in:
parent
3fdacaf932
commit
89cb90a6aa
@ -103,11 +103,15 @@ return require('packer').startup(function()
|
|||||||
-- LSP
|
-- LSP
|
||||||
use {
|
use {
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
config = function() require("utils").require_with_local("plugins.lsp") end,
|
config = function() require("plugins.lsp").config_lsp() end,
|
||||||
|
requires = {
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
"glepnir/lspsaga.nvim",
|
"glepnir/lspsaga.nvim",
|
||||||
requires = "neovim/nvim-lspconfig",
|
requires = "neovim/nvim-lspconfig",
|
||||||
|
config = function() require("plugins.lsp").config_lsp_saga() end,
|
||||||
}
|
}
|
||||||
--[[
|
--[[
|
||||||
use {
|
use {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
function M.config_cmp()
|
function M.config_cmp()
|
||||||
vim.o.completeopt = "menuone,noinsert,noselect"
|
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
cmp.setup {
|
cmp.setup {
|
||||||
completion = {
|
completion = {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
-- luacheck: globals packer_plugins
|
-- luacheck: globals packer_plugins
|
||||||
|
local M = {}
|
||||||
local utils = require("utils")
|
local utils = require("utils")
|
||||||
|
|
||||||
local function default_attach(client, bufnr)
|
local function default_attach(client, bufnr)
|
||||||
@ -66,9 +67,21 @@ local function default_attach(client, bufnr)
|
|||||||
buf_set_keymap("n", "<leader>t", "<cmd>Telescope lsp_document_symbols<CR>", opts)
|
buf_set_keymap("n", "<leader>t", "<cmd>Telescope lsp_document_symbols<CR>", opts)
|
||||||
buf_set_keymap("n", "<leader>ft", "<cmd>Telescope lsp_dynamic_workspace_symbols<CR>", opts)
|
buf_set_keymap("n", "<leader>ft", "<cmd>Telescope lsp_dynamic_workspace_symbols<CR>", opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Use LspSaga features, if possible
|
||||||
|
if packer_plugins["lspsaga.nvim"] then
|
||||||
|
buf_set_keymap('n', 'K', "<Cmd>lua require('lspsaga.hover').render_hover_doc()<CR>", opts)
|
||||||
|
buf_set_keymap('n', '<leader>rn', "<cmd>lua require('lspsaga.rename').rename()<CR>", opts)
|
||||||
|
buf_set_keymap('n', '<leader>e', "<cmd>lua require('lspsaga.diagnostic').show_line_diagnostics()<CR>", opts)
|
||||||
|
buf_set_keymap('n', '[d', "<cmd>lua require('lspsaga.diagnostic').lsp_jump_diagnostic_prev()<CR>", opts)
|
||||||
|
buf_set_keymap('n', ']d', "<cmd>lua require('lspsaga.diagnostic').lsp_jump_diagnostic_next()<CR>", opts)
|
||||||
|
buf_set_keymap('n', '<C-k>', "<cmd>lua require('lspsaga.signaturehelp').signature_help()<CR>", opts)
|
||||||
|
-- Code actions
|
||||||
|
buf_set_keymap('n', '<leader>ca', "<cmd>lua require('lspsaga.codeaction').code_action()<CR>", opts)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function config_lsp()
|
function M.config_lsp()
|
||||||
local language_servers = {
|
local language_servers = {
|
||||||
"bashls",
|
"bashls",
|
||||||
"gopls",
|
"gopls",
|
||||||
@ -105,4 +118,19 @@ local function config_lsp()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
config_lsp()
|
function M.config_lsp_saga()
|
||||||
|
local saga = require("lspsaga")
|
||||||
|
saga.init_lsp_saga{
|
||||||
|
error_sign = "🔥",
|
||||||
|
warn_sign ="⚠️",
|
||||||
|
hint_sign = "🤔",
|
||||||
|
dianostic_header_icon = " 💬 ",
|
||||||
|
code_action_icon = "💡",
|
||||||
|
code_action_prompt = {
|
||||||
|
enable = false,
|
||||||
|
sign = false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
Loading…
Reference in New Issue
Block a user