mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-16 00:03:03 +00:00
transfer
This commit is contained in:
parent
02c996d21a
commit
28622332a3
83 changed files with 6969 additions and 57 deletions
34
config/nvim/after/plugin/lsp.lua
Normal file
34
config/nvim/after/plugin/lsp.lua
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
local lsp = require('config.lsp')
|
||||
|
||||
vim.lsp.config('*', {
|
||||
capabilities = lsp.capabilities(),
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
||||
callback = function(ev)
|
||||
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||
if client then
|
||||
lsp.on_attach(client, ev.buf)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
for _, server in ipairs({
|
||||
'lua_ls',
|
||||
'pyright',
|
||||
'ts_ls',
|
||||
'rust_analyzer',
|
||||
'gopls',
|
||||
'clangd',
|
||||
'bashls',
|
||||
'jsonls',
|
||||
'html',
|
||||
'cssls',
|
||||
}) do
|
||||
local ok, config = pcall(require, 'lsp.' .. server)
|
||||
if ok then
|
||||
vim.lsp.config(server, config)
|
||||
end
|
||||
vim.lsp.enable(server)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue