mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-16 04:14:37 +02:00
feat(snacks): use bigfile
This commit is contained in:
parent
3d2b3c0516
commit
b7840f91a5
1 changed files with 0 additions and 26 deletions
|
@ -124,29 +124,3 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
|||
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
||||
end,
|
||||
})
|
||||
|
||||
vim.filetype.add({
|
||||
pattern = {
|
||||
[".*"] = {
|
||||
function(path, buf)
|
||||
return vim.bo[buf]
|
||||
and vim.bo[buf].filetype ~= "bigfile"
|
||||
and path
|
||||
and vim.fn.getfsize(path) > vim.g.bigfile_size
|
||||
and "bigfile"
|
||||
or nil
|
||||
end,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
group = augroup("bigfile"),
|
||||
pattern = "bigfile",
|
||||
callback = function(ev)
|
||||
vim.b.minianimate_disable = true
|
||||
vim.schedule(function()
|
||||
vim.bo[ev.buf].syntax = vim.filetype.match({ buf = ev.buf }) or ""
|
||||
end)
|
||||
end,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue