Skip to content

Instantly share code, notes, and snippets.

@smnatale
Created August 3, 2025 23:07
Show Gist options
  • Select an option

  • Save smnatale/2dd6cfb0d96818bbe44c03dc3d92f3d5 to your computer and use it in GitHub Desktop.

Select an option

Save smnatale/2dd6cfb0d96818bbe44c03dc3d92f3d5 to your computer and use it in GitHub Desktop.
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