don't call lsp setup twice, clieanup global opt setting

This commit is contained in:
Asmir A 2023-07-09 17:23:18 +02:00
parent 44eaabc43c
commit 2544f1130f

View File

@ -1,22 +1,30 @@
-- Basic settings -- Basic settings
vim.g.loaded_matchparen = true vim.g.loaded_matchparen = true
vim.g.netrw_liststyle = 3 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 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]]) vim.cmd([[colorscheme gruvbox]])
require 'nvim-treesitter.configs'.setup { 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() local capabilities = require('cmp_nvim_lsp').default_capabilities()
for _, lsp in pairs(servers) do for _, lsp in pairs(servers) do
require('lspconfig')[lsp].setup { require('lspconfig')[lsp].setup {
@ -193,6 +201,7 @@ for _, lsp in pairs(servers) do
end end
require('lspconfig').lua_ls.setup({ require('lspconfig').lua_ls.setup({
capabilities = capabilities,
single_file_support = true, single_file_support = true,
settings = { settings = {
Lua = { Lua = {
@ -209,11 +218,15 @@ require('lspconfig').lua_ls.setup({
[vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true, [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true,
}, },
}, },
telemetry = {
enable = false,
},
}, },
}, },
}) })
require('lspconfig').verible.setup({ require('lspconfig').verible.setup({
capabilities = capabilities,
root_dir = function() return vim.loop.cwd() end root_dir = function() return vim.loop.cwd() end
}) })