This commit is contained in:
Christian Nieves
2025-03-14 14:35:42 +00:00
parent 348b966c1a
commit 2907bda8d3
3 changed files with 125 additions and 123 deletions

View File

@ -3,26 +3,28 @@ return {
opts = {
filesize = 2, -- size of the file in MiB, the plugin round file sizes to the closest MiB
pattern = function(bufnr, filesize_mib)
vim.b.codefmt_formatt= ""
vim.cmd(":FormatDisable")
-- you can't use `nvim_buf_line_count` because this runs on BufReadPre
local file_contents = vim.fn.readfile(vim.api.nvim_buf_get_name(bufnr))
local file_lines = #file_contents
local filetype = vim.filetype.match({ buf = bufnr })
if file_lines > 1000 and (filetype == "c" or filetype == "cpp") then
return true
if filetype == "c" or filetype == "cpp" then
if file_lines > 1000 then
vim.b.codefmt_formatt = "" -- disable codefmt
vim.cmd(":FormatDisable") -- disable conform
return true
end
end
return filesize_mib > 1
end,
features = { -- features to disable
"indent_blankline",
-- "illuminate",
"illuminate",
"lsp",
"treesitter",
-- "syntax",
-- "matchparen",
"matchparen",
-- "vimopts",
"filetype",
-- "filetype",
},
}
}