mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-16 20:34:39 +02:00
feat(snacks): use quickfile
This commit is contained in:
parent
39dca19a3f
commit
3d2b3c0516
1 changed files with 0 additions and 25 deletions
|
@ -71,31 +71,6 @@ function M.extra_idx(name)
|
|||
end
|
||||
|
||||
function M.lazy_file()
|
||||
-- This autocmd will only trigger when a file was loaded from the cmdline.
|
||||
-- It will render the file as quickly as possible.
|
||||
vim.api.nvim_create_autocmd("BufReadPost", {
|
||||
once = true,
|
||||
callback = function(event)
|
||||
-- Skip if we already entered vim
|
||||
if vim.v.vim_did_enter == 1 then
|
||||
return
|
||||
end
|
||||
|
||||
-- Try to guess the filetype (may change later on during Neovim startup)
|
||||
local ft = vim.filetype.match({ buf = event.buf })
|
||||
if ft then
|
||||
-- Add treesitter highlights and fallback to syntax
|
||||
local lang = vim.treesitter.language.get_lang(ft)
|
||||
if not (lang and pcall(vim.treesitter.start, event.buf, lang)) then
|
||||
vim.bo[event.buf].syntax = ft
|
||||
end
|
||||
|
||||
-- Trigger early redraw
|
||||
vim.cmd([[redraw]])
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Add support for the LazyFile event
|
||||
local Event = require("lazy.core.handler.event")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue