From 23959a9b7732813f8a8c3d5f16c49a50d24f6d11 Mon Sep 17 00:00:00 2001 From: rootiest Date: Sat, 8 Feb 2025 20:06:53 -0500 Subject: [PATCH] add autocmd for non-ignored fts used to lazy-load on actual normal buffer opening --- lua/config/autocmds.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index b8b7c6a..529b190 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -131,3 +131,17 @@ autocmd('CmdlineLeave', { end end, }) + +autogrp('RootyCustomEvent', { clear = true }) + +autocmd({ 'BufReadPost', 'BufNewFile' }, { + group = 'RootyCustomEvent', + callback = function(args) + local ignored_filetypes = require('data.types').general.ft + local ft = vim.bo[args.buf].filetype + + if not vim.tbl_contains(ignored_filetypes, ft) then + vim.api.nvim_exec_autocmds('User', { pattern = 'LazyFileOpen' }) + end + end, +})