From 5a13d12e33d80c42daed96f723f59df6e6c92d7b Mon Sep 17 00:00:00 2001 From: Daniel Carrillo Date: Tue, 1 Nov 2022 18:14:36 +0100 Subject: [PATCH] [neovim] Disable illuminate on very large files --- .config/nvim/lua/core/autocommands.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.config/nvim/lua/core/autocommands.lua b/.config/nvim/lua/core/autocommands.lua index 86fe8ec..5da7b77 100644 --- a/.config/nvim/lua/core/autocommands.lua +++ b/.config/nvim/lua/core/autocommands.lua @@ -32,3 +32,13 @@ vim.api.nvim_create_autocmd({ "FileType" }, { ]]) end, }) + +-- Disable illuminate on very large files +vim.api.nvim_create_autocmd({ "BufWinEnter" }, { + callback = function() + local line_count = vim.api.nvim_buf_line_count(0) + if line_count >= 5000 then + vim.cmd("IlluminatePauseBuf") + end + end, +})