Tried to add lsp

This commit is contained in:
Nikurasu 2022-12-23 11:28:12 +01:00
parent 23cf0f1b2e
commit 8e7a295332
6 changed files with 54 additions and 1 deletions

View file

@ -9,7 +9,6 @@ end
require('plugins.packer') require('plugins.packer')
-- When we are bootstrapping a configuration, it doesn't -- When we are bootstrapping a configuration, it doesn't
-- make sense to execute the rest of the init.lua. -- make sense to execute the rest of the init.lua.
-- --

View file

@ -0,0 +1,8 @@
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
require('cmp').setup({
sources = {
{ name = 'nvim_lsp' },
}
})

View file

@ -0,0 +1 @@
require('fidget').setup()

View file

@ -0,0 +1 @@
require("mason").setup()

View file

@ -0,0 +1,22 @@
local mason_lspconfig = require 'mason-lspconfig'
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
local servers = {
tsserver = {},
}
mason_lspconfig.setup {
ensure_installed = vim.tbl_keys(servers),
}
mason_lspconfig.setup_handlers {
function(server_name)
require('lspconfig')[server_name].setup {
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
}
end,
}

View file

@ -33,6 +33,28 @@ return require('packer').startup(function(use)
} }
use 'p00f/nvim-ts-rainbow' use 'p00f/nvim-ts-rainbow'
use 'jiangmiao/auto-pairs' use 'jiangmiao/auto-pairs'
use {
'williamboman/mason.nvim',
requires = {
'neovim/nvim-lspconfig',
{
'williamboman/mason-lspconfig.nvim',
config = [[require('plugins.mason.lspconfig')]]
},
{
'j-hui/fidget.nvim',
config = [[require('plugins.fidget')]]
}
},
config = [[require('plugins.mason')]]
}
use {
'hrsh7th/nvim-cmp',
requires = {
'hrsh7th/cmp-nvim-lsp'
},
config = [[require('plugins.cmp')]]
}
if is_bootstrap then if is_bootstrap then
require('packer').sync() require('packer').sync()