save
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
vim.bo.filetype = "c"
|
|
||||||
@@ -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
|
|
||||||
@@ -38,6 +38,13 @@ vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
||||||
|
pattern = "*.h",
|
||||||
|
callback = function()
|
||||||
|
vim.bo.filetype = "c"
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
vim.pack.add {
|
vim.pack.add {
|
||||||
{ src = "https://github.com/echasnovski/mini.pick" },
|
{ src = "https://github.com/echasnovski/mini.pick" },
|
||||||
{ src = "https://github.com/mason-org/mason.nvim" },
|
{ src = "https://github.com/mason-org/mason.nvim" },
|
||||||
@@ -47,5 +54,19 @@ vim.pack.add {
|
|||||||
require("mini.pick").setup()
|
require("mini.pick").setup()
|
||||||
require("mason").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.lsp.enable { "lua_ls", "clangd", "beautysh" }
|
||||||
vim.diagnostic.config { virtual_text = true, underline = true, signs = false }
|
vim.diagnostic.config { virtual_text = true, underline = true, signs = false }
|
||||||
|
|||||||
Reference in New Issue
Block a user