include i3 and nvim configuration in the central repository, rather than keep them in their seperate respective ones.
This commit is contained in:
51
.config/nvim/lua/plugin/lspconfig.lua
Normal file
51
.config/nvim/lua/plugin/lspconfig.lua
Normal file
@@ -0,0 +1,51 @@
|
||||
---@module 'lazy'
|
||||
---@type LazySpec
|
||||
return { {
|
||||
'neovim/nvim-lspconfig',
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = { 'saghen/blink.cmp' },
|
||||
---@type table<string, boolean|vim.lsp.Config>
|
||||
opts = {
|
||||
['clangd'] = true,
|
||||
['ccls'] = false,
|
||||
['glsl_analyzer'] = true,
|
||||
['rust_analyzer'] = true,
|
||||
['omnisharp'] = false,
|
||||
['lua_ls'] = true,
|
||||
|
||||
['html'] = true,
|
||||
['cssls'] = true,
|
||||
['ts_ls'] = true,
|
||||
|
||||
['jsonls'] = true,
|
||||
['yamlls'] = {
|
||||
settings = {
|
||||
yaml = {
|
||||
schemas = {
|
||||
["https://json.schemastore.org/github-workflow.json"] =
|
||||
"/.github/workflows/*",
|
||||
["https://json.schemastore.org/clang-format"] = ".clang-format",
|
||||
["https://json.schemastore.org/clang-tidy"] = ".clang-tidy",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
---@param opts table<string,boolean|vim.lsp.Config>
|
||||
config = function(_, opts)
|
||||
-- store the default capabilities
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
|
||||
-- enable the LSP
|
||||
for server, config in pairs(opts) do
|
||||
if type(config) == 'boolean' then
|
||||
vim.lsp.enable(server, config)
|
||||
else
|
||||
vim.lsp.enable(server, true)
|
||||
vim.lsp.config[server] = vim.tbl_deep_extend('force', {}, vim.lsp.config[server],
|
||||
config or {})
|
||||
end
|
||||
vim.lsp.config[server].capabilities = capabilities
|
||||
end
|
||||
end
|
||||
} }
|
||||
Reference in New Issue
Block a user