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
59
60
61
62
63
64
65
66
67
68
69
70
71
|
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
-- if you just want default config for the servers then put them in a table
local servers = { "clangd", "cssls", "emmet_language_server", "html", "julials", "sqlls", "tsserver" }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
capabilities = capabilities,
}
end
--
-- lspconfig.pyright.setup { blabla}
local on_attach_qmd = function(client, bufnr)
local function buf_set_keymap(...)
vim.api.nvim_buf_set_keymap(bufnr, ...)
end
local function buf_set_option(...)
vim.api.nvim_buf_set_option(bufnr, ...)
end
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
local opts = { noremap = true, silent = true }
end
local lsp_flags = {
allow_incremental_sync = true,
debounce_text_changes = 150,
}
local cmp_nvim_lsp = require "cmp_nvim_lsp"
local util = require "lspconfig.util"
lspconfig.marksman.setup {
on_attach = on_attach_qmd,
capabilities = capabilities,
filetypes = { "markdown", "quarto" },
root_dir = util.root_pattern(".git", ".marksman.toml", "_quarto.yml"),
}
-- lspconfig.r_language_server.setup {
-- on_attach = on_attach,
-- capabilities = capabilities,
-- flags = lsp_flags,
-- settings = {
-- r = {
-- lsp = {
-- rich_documentation = false,
-- },
-- },
-- },
-- }
lspconfig.yamlls.setup {
on_attach = on_attach,
capabilities = capabilities,
flags = lsp_flags,
settings = {
yaml = {
schemas = {
-- add custom schemas here
-- e.g.
["https://raw.githubusercontent.com/hits-mbm-dev/kimmdy/main/src/kimmdy/kimmdy-yaml-schema.json"] = "kimmdy.yml",
},
},
},
}
|