diff --git a/nvim/init.lua b/nvim/init.lua index e0c1c3a..2a5a928 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -6,7 +6,7 @@ if vim.fn.empty(vim.fn.glob(install_path)) > 0 then vim.fn.system{'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path } vim.cmd [[packadd packer.nvim]] end -vim + -- Install Plugins require('packer').startup(function(use) use 'wbthomason/packer.nvim' @@ -83,13 +83,15 @@ require("neodev").setup({ -- add any options here, or leave empty to use the default settings }) +local lspconfig = require('lspconfig') + -- lsp configs -require('lspconfig')['tsserver'].setup{ +lspconfig.tsserver.setup{ on_attach = on_attach, flags = lsp_flags } -require('lspconfig')['lua_ls'].setup{ +lspconfig.lua_ls.setup{ on_attach = on_attach, flags = lsp_flags, capabilities = capabilities, @@ -97,29 +99,32 @@ require('lspconfig')['lua_ls'].setup{ Lua = { completion = { callSnippet = "Replace" + }, + diagnostics = { + globals = {'vim'}, } } } } -require('lspconfig')['gopls'].setup{ +lspconfig.gopls.setup{ on_attach = on_attach, flags = lsp_flags } -require('lspconfig')['emmet_ls'].setup{ +lspconfig.emmet_ls.setup{ on_attach = on_attach, flags = lsp_flags, capabilities = capabilities } -require'lspconfig'.cssls.setup{ +lspconfig.cssls.setup{ on_attach = on_attach, flags = lsp_flags, capabilities = capabilities } -require('lspconfig')['docker_compose_language_service'].setup{ +lspconfig.docker_compose_language_service.setup{ on_attach = on_attach, flags = lsp_flags, capabilities = capabilities