diff --git a/nvim/init.lua b/nvim/init.lua index 5d16eb1..ca99d5c 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -9,7 +9,6 @@ end require('plugins.packer') - -- When we are bootstrapping a configuration, it doesn't -- make sense to execute the rest of the init.lua. -- diff --git a/nvim/lua/plugins/cmp/init.lua b/nvim/lua/plugins/cmp/init.lua new file mode 100644 index 0000000..a116819 --- /dev/null +++ b/nvim/lua/plugins/cmp/init.lua @@ -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' }, + } +}) \ No newline at end of file diff --git a/nvim/lua/plugins/fidget/init.lua b/nvim/lua/plugins/fidget/init.lua new file mode 100644 index 0000000..427cdec --- /dev/null +++ b/nvim/lua/plugins/fidget/init.lua @@ -0,0 +1 @@ +require('fidget').setup() \ No newline at end of file diff --git a/nvim/lua/plugins/mason/init.lua b/nvim/lua/plugins/mason/init.lua new file mode 100644 index 0000000..03646c3 --- /dev/null +++ b/nvim/lua/plugins/mason/init.lua @@ -0,0 +1 @@ +require("mason").setup() \ No newline at end of file diff --git a/nvim/lua/plugins/mason/lspconfig/init.lua b/nvim/lua/plugins/mason/lspconfig/init.lua new file mode 100644 index 0000000..f75c65e --- /dev/null +++ b/nvim/lua/plugins/mason/lspconfig/init.lua @@ -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, +} \ No newline at end of file diff --git a/nvim/lua/plugins/packer/init.lua b/nvim/lua/plugins/packer/init.lua index fc5ca39..ecb84d4 100644 --- a/nvim/lua/plugins/packer/init.lua +++ b/nvim/lua/plugins/packer/init.lua @@ -33,6 +33,28 @@ return require('packer').startup(function(use) } use 'p00f/nvim-ts-rainbow' 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 require('packer').sync()