Tried to add lsp
This commit is contained in:
parent
23cf0f1b2e
commit
8e7a295332
6 changed files with 54 additions and 1 deletions
|
@ -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.
|
||||||
--
|
--
|
||||||
|
|
8
nvim/lua/plugins/cmp/init.lua
Normal file
8
nvim/lua/plugins/cmp/init.lua
Normal 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' },
|
||||||
|
}
|
||||||
|
})
|
1
nvim/lua/plugins/fidget/init.lua
Normal file
1
nvim/lua/plugins/fidget/init.lua
Normal file
|
@ -0,0 +1 @@
|
||||||
|
require('fidget').setup()
|
1
nvim/lua/plugins/mason/init.lua
Normal file
1
nvim/lua/plugins/mason/init.lua
Normal file
|
@ -0,0 +1 @@
|
||||||
|
require("mason").setup()
|
22
nvim/lua/plugins/mason/lspconfig/init.lua
Normal file
22
nvim/lua/plugins/mason/lspconfig/init.lua
Normal 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,
|
||||||
|
}
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue