From 936a32428256c35e944bbeca94dcb1afc2801bc1 Mon Sep 17 00:00:00 2001 From: Anton Volnuhin Date: Tue, 9 May 2023 02:07:18 +0300 Subject: [PATCH] mason, lspconfig, lua_ls, mini.completions --- private_dot_config/nvim/init.lua | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/private_dot_config/nvim/init.lua b/private_dot_config/nvim/init.lua index 9bf2c17..53f9ddc 100644 --- a/private_dot_config/nvim/init.lua +++ b/private_dot_config/nvim/init.lua @@ -27,6 +27,10 @@ require("lazy").setup({ { "mbbill/undotree" }, { "phaazon/hop.nvim" }, { "echasnovski/mini.nvim", version = "*" }, + { + "williamboman/mason.nvim", + build = ":MasonUpdate", -- :MasonUpdate updates registry contents + }, { "folke/which-key.nvim", config = function() @@ -48,6 +52,8 @@ require("lazy").setup({ }) end, }, + { "williamboman/mason-lspconfig.nvim" }, + { "neovim/nvim-lspconfig" }, }) require("hop").setup() @@ -59,6 +65,43 @@ require("mini.statusline").setup() require("mini.tabline").setup() require("mini.bracketed").setup() require("mini.surround").setup() +require("mini.completion").setup() + +require("mason").setup({ + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗", + }, + }, +}) +require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls", "rust_analyzer" }, +}) +require("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), + checkThirdParty = false, + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, +}) require("osc52").setup({ max_length = 0, -- Maximum length of selection (0 for no limit)