feat(bigfile): add bigfile module

This commit is contained in:
Rubin Bhandari 2024-05-31 20:19:54 +05:45
parent ae381c91a1
commit 97b22ac13c

View file

@ -0,0 +1,19 @@
return {
"LunarVim/bigfile.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = {
pattern = function(bufnr, filesize_mib)
if filesize_mib >= 2 then
return true
end
-- 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_length = #file_contents
if file_length > 5000 then
return true
end
return false
end,
},
}