lsp_config.lua (778B)
1 local lsp_zero = require('lsp-zero') 2 3 lsp_zero.on_attach(function(client, bufnr) 4 -- see :help lsp-zero-keybindings 5 -- to learn the available actions 6 lsp_zero.default_keymaps({buffer = bufnr}) 7 end) 8 9 require('mason').setup({}) 10 11 -- just in case: there is no need to copy/paste this example in your own config 12 -- this snippet exists only for educational purpose. 13 14 vim.lsp.config('lua_ls', { 15 settings = { 16 Lua = { 17 runtime = { version = 'LuaJIT' }, 18 diagnostics = { globals = { 'vim' } }, 19 workspace = { 20 library = vim.api.nvim_get_runtime_file('', true), 21 checkThirdParty = false, 22 }, 23 telemetry = { enable = false }, 24 }, 25 }, 26 }) 27 28 require('mason').setup() 29 require('mason-lspconfig').setup({ 30 ensure_installed = { 'lua_ls' }, 31 })