Add autoclose, tabout nvim autocomplete and Format on save

This commit is contained in:
Zam Kokott
2025-11-12 11:15:38 +00:00
parent 418840eb27
commit 7c0f9e6cca
4 changed files with 73 additions and 2 deletions

View File

@@ -1,8 +1,19 @@
return {
"neovim/nvim-lspconfig",
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"mason-org/mason.nvim",
"mason-org/mason-lspconfig.nvim",
{
"folke/lazydev.nvim",
ft = "lua", -- only load on lua files
opts = {
library = {
-- See the configuration section for more details
-- Load luvit types when the `vim.uv` word is found
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
},
},
},
},
config = function()
local capabilities = require("cmp_nvim_lsp").default_capabilities()
@@ -42,5 +53,19 @@ return {
}
})
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("lsp", { clear = true }),
callback = function(args)
-- 2
vim.api.nvim_create_autocmd("BufWritePre", {
-- 3
buffer = args.buf,
callback = function()
-- 4 + 5
vim.lsp.buf.format { async = false, id = args.data.client_id }
end,
})
end
})
end,
}