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
|
@ -42,6 +42,7 @@
|
|||
shellcheck
|
||||
shfmt
|
||||
stylua
|
||||
superhtml
|
||||
vscode-langservers-extracted
|
||||
];
|
||||
|
||||
|
@ -59,7 +60,7 @@
|
|||
}
|
||||
|
||||
{
|
||||
plugin = blink-cmp;
|
||||
plugin = pkgs.blink-cmp;
|
||||
type = "lua";
|
||||
config = ''
|
||||
require'blink-cmp'.setup({
|
||||
|
@ -68,27 +69,31 @@
|
|||
["<PageDown>"] = { "scroll_documentation_down" },
|
||||
["<PageUp>"] = { "scroll_documentation_up" },
|
||||
},
|
||||
trigger = {
|
||||
completion = {
|
||||
show_in_snippet = true,
|
||||
},
|
||||
signature_help = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
windows = {
|
||||
autocomplete = {
|
||||
border = 'none',
|
||||
selection = 'preselect',
|
||||
completion = {
|
||||
accept = {
|
||||
auto_brackets = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
|
||||
documentation = {
|
||||
border = 'rounded',
|
||||
auto_show = false,
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 800,
|
||||
window = {
|
||||
border = 'rounded',
|
||||
},
|
||||
ghost_text = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
signature_help = {
|
||||
border = 'rounded',
|
||||
|
||||
signature = {
|
||||
enabled = true,
|
||||
window = {
|
||||
border = 'rounded',
|
||||
},
|
||||
},
|
||||
|
||||
},
|
||||
})
|
||||
'';
|
||||
|
@ -100,8 +105,8 @@
|
|||
src = pkgs.fetchFromGitHub {
|
||||
owner = "saghen";
|
||||
repo = "blink.compat";
|
||||
rev = "cd2d3a040b76ad0eeab9a3bba48bc4c2b9d703bf"; # v1.0.2
|
||||
hash = "sha256-4uoehv/qe74IivgXc69ekYLod3Zo+oPUvXJHtt4wc2U=";
|
||||
rev = "78f3f7187ff4a1444e952548c556d936da8f72fc"; # v2.1.2
|
||||
hash = "sha256-aqHDwrzPOyOw9UbJlQX10/cVQwNHg4v6i9jSm+pNKZc=";
|
||||
};
|
||||
};
|
||||
type = "lua";
|
||||
|
|
|
@ -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