86 lines
1.7 KiB
Lua
86 lines
1.7 KiB
Lua
vim.pack.add({
|
|
{ src = "https://github.com/neovim/nvim-lspconfig", name = "lspconfig" },
|
|
{ src = "https://github.com/saghen/blink.cmp", name = "blink" },
|
|
})
|
|
|
|
vim.lsp.config("lua_ls", {
|
|
settings = {
|
|
Lua = {
|
|
-- Tell the server to let Neovim handle snippet expansion
|
|
completion = {
|
|
callSnippet = "Replace",
|
|
},
|
|
-- Use LuaJIT (which Neovim uses)
|
|
runtime = {
|
|
version = "LuaJIT",
|
|
},
|
|
},
|
|
},
|
|
})
|
|
vim.lsp.config("emmet_ls", {
|
|
-- capabilities = require("cmp_nvim_lsp").default_capabilities(),
|
|
filetypes = { "html", "css", "javascriptreact", "typescriptreact" },
|
|
init_options = {
|
|
html = {
|
|
options = {
|
|
["bem.enabled"] = true,
|
|
},
|
|
},
|
|
},
|
|
})
|
|
vim.lsp.enable({
|
|
"lua_ls",
|
|
"ts_ls",
|
|
"pylsp",
|
|
"cssls",
|
|
"nixd",
|
|
"rust_analyzer",
|
|
"emmet_ls",
|
|
})
|
|
|
|
vim.o.pumborder = "rounded"
|
|
|
|
require("blink.cmp").setup({
|
|
-- Snippet configuration
|
|
-- snippets = {
|
|
-- preset = "luasnip", -- Tells blink.cmp to use LuaSnip
|
|
-- },
|
|
|
|
fuzzy = { implementation = "lua" },
|
|
|
|
signature = {
|
|
enabled = true,
|
|
},
|
|
|
|
completion = {
|
|
list = {
|
|
selection = {
|
|
preselect = false,
|
|
auto_insert = true,
|
|
},
|
|
},
|
|
},
|
|
|
|
-- Keymaps
|
|
keymap = {
|
|
["<Tab>"] = { "select_next", "snippet_forward", "fallback" },
|
|
},
|
|
sources = {
|
|
default = {
|
|
"lsp", -- (Equivalent to cmp-nvim-lsp)
|
|
"snippets", -- (Handled by the snippets config, replaces cmp_luasnip source)
|
|
"buffer", -- (Equivalent to cmp-buffer)
|
|
"path", -- (Equivalent to cmp-path)
|
|
-- "cmdline", -- Generally configured separately, but often included by default
|
|
},
|
|
providers = {
|
|
-- lazydev = {
|
|
-- name = "LazyDev",
|
|
-- module = "lazydev.integrations.blink",
|
|
-- -- make lazydev completions top priority (see `:h blink.cmp`)
|
|
-- score_offset = 100,
|
|
-- },
|
|
},
|
|
},
|
|
})
|