mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Update bigfile.lua
This commit is contained in:
parent
97b22ac13c
commit
ba0e1d916c
1 changed files with 5 additions and 17 deletions
|
|
@ -1,19 +1,7 @@
|
|||
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,
|
||||
},
|
||||
"LunarVim/bigfile.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
filesize = 2, -- size of the file in MiB, the plugin round file sizes to the closest MiB
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue