This commit is contained in:
2025-09-23 15:27:13 -04:00
parent 8b82957b39
commit fcec9f0c19
3 changed files with 29 additions and 14 deletions

View File

@@ -1 +0,0 @@
vim.bo.filetype = "c"

View File

@@ -1,5 +0,0 @@
vim.opt.spell = true
vim.opt_local.tabstop = 2
vim.opt_local.shiftwidth = 2
vim.opt_local.expandtab = true
vim.opt_local.textwidth = 80

View File

@@ -38,6 +38,13 @@ vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
end,
})
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = "*.h",
callback = function()
vim.bo.filetype = "c"
end,
})
vim.pack.add {
{ src = "https://github.com/echasnovski/mini.pick" },
{ src = "https://github.com/mason-org/mason.nvim" },
@@ -47,5 +54,19 @@ vim.pack.add {
require("mini.pick").setup()
require("mason").setup()
require 'lspconfig'.clangd.setup {
filetypes = { "c", "cpp" },
init_options = {
compilationDatabasePath = "build",
},
on_attach = function(client, bufnr)
if vim.bo.filetype == "c" and vim.fn.expand("%:e") == "h" then
client.config.flags = client.config.flags or {}
client.config.flags.allow_incremental_sync = true
end
end,
}
vim.lsp.enable { "lua_ls", "clangd", "beautysh" }
vim.diagnostic.config { virtual_text = true, underline = true, signs = false }