From 2544f1130fd224cfbcd86c2210ecaaee7260d5a3 Mon Sep 17 00:00:00 2001 From: Asmir A Date: Sun, 9 Jul 2023 17:23:18 +0200 Subject: [PATCH] don't call lsp setup twice, clieanup global opt setting --- vimrc.lua | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/vimrc.lua b/vimrc.lua index c8e8236..6527525 100644 --- a/vimrc.lua +++ b/vimrc.lua @@ -1,22 +1,30 @@ -- Basic settings vim.g.loaded_matchparen = true vim.g.netrw_liststyle = 3 -vim.go.background = 'dark' -vim.go.belloff = 'all' -vim.go.breakindent = true -vim.go.hlsearch = false -vim.go.laststatus = 0 -vim.go.lazyredraw = true -vim.go.showcmd = true -vim.go.synmaxcol = 800 -vim.go.syntax = 'on' -vim.go.termguicolors = true -vim.go.titleold = vim.fn.getcwd() -vim.go.title = true -vim.go.wildmenu = true -vim.go.wrap = true vim.wo.number = true +local glob_opts = { + background = 'dark', + belloff = 'all', + breakindent = true, + hlsearch = false, + laststatus = 0, + lazyredraw = true, + showcmd = true, + synmaxcol = 800, + syntax = 'on', + termguicolors = true, + titleold = vim.fn.getcwd(), + title = true, + wildmenu = true, + wrap = true, +} + +for option, value in pairs(glob_opts) do + vim.go[option] = value +end + + vim.cmd([[colorscheme gruvbox]]) require 'nvim-treesitter.configs'.setup { @@ -184,7 +192,7 @@ cmp.setup({ } }) -local servers = { 'pyright', 'rust_analyzer', 'ccls', 'lua_ls', 'nixd', 'texlab', 'verible' } +local servers = { 'pyright', 'rust_analyzer', 'ccls', 'nixd', 'texlab' } local capabilities = require('cmp_nvim_lsp').default_capabilities() for _, lsp in pairs(servers) do require('lspconfig')[lsp].setup { @@ -193,6 +201,7 @@ for _, lsp in pairs(servers) do end require('lspconfig').lua_ls.setup({ + capabilities = capabilities, single_file_support = true, settings = { Lua = { @@ -209,11 +218,15 @@ require('lspconfig').lua_ls.setup({ [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true, }, }, + telemetry = { + enable = false, + }, }, }, }) require('lspconfig').verible.setup({ + capabilities = capabilities, root_dir = function() return vim.loop.cwd() end })