nvim: upgrade blink-cmp. lsp config for web stuff.
This commit is contained in:
parent
7a4712c057
commit
37ddc91613
4 changed files with 106 additions and 56 deletions
home/common/nvim
|
@ -1,44 +1,43 @@
|
|||
local configs = require('lspconfig.configs')
|
||||
local lspconfig = require("lspconfig")
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
local servers = {
|
||||
'gopls',
|
||||
'ts_ls',
|
||||
}
|
||||
cssls = {},
|
||||
gopls = {},
|
||||
html = {},
|
||||
jsonls = {},
|
||||
superhtml = {},
|
||||
ts_ls = {},
|
||||
|
||||
for _, ls in ipairs(servers) do
|
||||
lspconfig[ls].setup {
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end
|
||||
|
||||
lspconfig.nixd.setup({
|
||||
capabilities = capabilities,
|
||||
cmd = { "nixd" },
|
||||
settings = {
|
||||
nixd = {
|
||||
nixpkgs = { expr = "import <nixpkgs> { }" },
|
||||
formatting = { command = { "nixfmt" } },
|
||||
options = {},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
lspconfig.lua_ls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
path = vim.split(package.path, ";"),
|
||||
},
|
||||
diagnostics = { globals = { "vim", "hs" } },
|
||||
workspace = {
|
||||
library = {
|
||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
[vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true,
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
path = vim.split(package.path, ";"),
|
||||
},
|
||||
diagnostics = { globals = { "vim", "hs" } },
|
||||
workspace = {
|
||||
library = {
|
||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
[vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
nixd = {
|
||||
cmd = { "nixd" },
|
||||
settings = {
|
||||
nixd = {
|
||||
nixpkgs = { expr = "import <nixpkgs> { }" },
|
||||
formatting = { command = { "nixfmt" } },
|
||||
options = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for server, config in pairs(servers) do
|
||||
config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
|
||||
lspconfig[server].setup(config)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue