summaryrefslogtreecommitdiff
path: root/config/nvim/lua/plugins/lspconfig.lua
blob: 59085f91120bd2582043e7953df9d7e49d807978 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
return {
	"neovim/nvim-lspconfig",
	dependencies = { "saghen/blink.cmp" },
	keys = {
		{
			"d[",
			vim.diagnostic.goto_prev,
			desc = "Previous diagnostic",
		},
		{
			"d]",
			vim.diagnostic.goto_next,
			desc = "Next diagnostic",
		},
		{
			"gD",
			vim.lsp.buf.declaration,
			desc = "Go to declaration",
		},
		{
			"gd",
			vim.lsp.buf.definition,
			desc = "Go to definition",
		},
		{
			"K",
			vim.lsp.buf.hover,
			desc = "Show documentation",
		},
		{
			"<A-CR>",
			"<cmd>Lspsaga code_action<cr>",
			desc = "Code actions",
		},
		{
			"<F2>",
			vim.lsp.buf.rename,
			desc = "Rename symbol",
		},
		{
			"<leader>wa",
			vim.lsp.buf.add_workspace_folder,
			desc = "Add workspace folder",
		},
		{
			"<leader>wr",
			vim.lsp.buf.remove_workspace_folder,
			desc = "Remove workspace folder",
		},
		{
			"<leader>wl",
			function()
				print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
			end,
			desc = "List workspace folders",
		},
	},
}