sorry, i forgot to update this more regularly

This commit is contained in:
TJ DeVries
2024-12-18 19:14:08 -05:00
parent 916560e22c
commit b2ac96c3cf
20 changed files with 459 additions and 10 deletions

View File

@@ -0,0 +1,37 @@
return {
{
"neovim/nvim-lspconfig",
dependencies = {
'saghen/blink.cmp',
{
"folke/lazydev.nvim",
opts = {
library = {
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
},
},
},
},
config = function()
local capabilities = require('blink.cmp').get_lsp_capabilities()
require("lspconfig").lua_ls.setup { capabilites = capabilities }
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(args)
local c = vim.lsp.get_client_by_id(args.data.client_id)
if not c then return end
if vim.bo.filetype == "lua" then
-- Format the current buffer on save
vim.api.nvim_create_autocmd('BufWritePre', {
buffer = args.buf,
callback = function()
vim.lsp.buf.format({ bufnr = args.buf, id = c.id })
end,
})
end
end,
})
end,
}
}