From 13ceaab631bc38d3878d10a9f35705457ca38e34 Mon Sep 17 00:00:00 2001 From: Brahmajit Das Date: Sun, 30 Jul 2023 13:21:57 +0530 Subject: nvim: init.lua: setup clangd and lua-language-ls automatically Signed-off-by: Brahmajit Das --- init.lua | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 35cd91b..fdaf8e6 100644 --- a/init.lua +++ b/init.lua @@ -14,7 +14,6 @@ require('plugins.vimtex') require('plugins.nvim-tree') require('plugins.gitsigns') require('plugins.autopairs') - require('core.appearance') require('core.options') require('core.utils') @@ -23,3 +22,29 @@ require('core.keymaps') require('core.colorscheme') require'colorizer'.setup() + +-- Setup language servers. +local lspconfig = require('lspconfig') +lspconfig.clangd.setup{} +lspconfig.lua_ls.setup { + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT', + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {'vim'}, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true), + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, +} -- cgit v1.2.3