Created
August 3, 2025 23:07
-
-
Save smnatale/2dd6cfb0d96818bbe44c03dc3d92f3d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vim.opt.number = true | |
| vim.opt.relativenumber = true | |
| vim.opt.tabstop = 2 | |
| vim.opt.softtabstop = 2 | |
| vim.pack.add({ | |
| { src = "https://github.com/neovim/nvim-lspconfig" }, | |
| { src = "https://github.com/mason-org/mason.nvim" }, | |
| { src = "https://github.com/mason-org/mason-lspconfig.nvim" }, | |
| { src = "https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim" }, | |
| }) | |
| require("mason").setup() | |
| require("mason-lspconfig").setup() | |
| require("mason-tool-installer").setup({ | |
| ensure_installed = { | |
| "lua_ls", | |
| "stylua", | |
| }, | |
| }) | |
| vim.lsp.config("lua_ls", { | |
| settings = { | |
| Lua = { | |
| runtime = { | |
| version = "LuaJIT", | |
| }, | |
| diagnostics = { | |
| globals = { | |
| "vim", | |
| "require", | |
| }, | |
| }, | |
| workspace = { | |
| library = vim.api.nvim_get_runtime_file("", true), | |
| }, | |
| telemetry = { | |
| enable = false, | |
| }, | |
| }, | |
| }, | |
| }) | |
| vim.cmd("set completeopt+=noselect") | |
| vim.api.nvim_create_autocmd("LspAttach", { | |
| callback = function(ev) | |
| local client = vim.lsp.get_client_by_id(ev.data.client_id) | |
| if client ~= nil and client:supports_method("textDocument/completion") then | |
| vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true }) | |
| end | |
| end, | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment