aboutsummaryrefslogtreecommitdiff
path: root/lua/config/lsp.lua
blob: 51ed5ec92d9e1ddc855ad889688cf7fa11ad25b1 (plain)
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
vim.pack.add({
	{ src = "https://github.com/saghen/blink.cmp", version = vim.version.range("*") },
	"https://github.com/neovim/nvim-lspconfig",
	"https://github.com/rafamadriz/friendly-snippets",
	"https://github.com/mason-org/mason-lspconfig.nvim",
	"https://github.com/mason-org/mason.nvim",
})

require("mason").setup()
require("mason-lspconfig").setup()

vim.lsp.enable({
	"bashls",
	"lua_ls",
	"sourcekit",
	"ts_ls",
	"css_ls",
	"emmet_language_server",
	"svelte",
	"astro",
	"cobol_ls",
	"lemminx",
})

require("blink.cmp").setup({
	signature = { enabled = true },
})

vim.keymap.set("n", "grd", function()
	vim.lsp.buf.definition()
end)

vim.keymap.set("n", "grl", function()
	vim.diagnostic.open_float()
end)

vim.keymap.set("n", "[d", function()
	vim.diagnostic.jump({ count = -1, float = true })
end)

vim.keymap.set("n", "]d", function()
	vim.diagnostic.jump({ count = 1, float = true })
end)