vim-hexokinase
vim-hexokinase copied to clipboard
Too many files open when running :vimgrep on large directory
I ran into an issue while running :vimgrep
inside a directory with a large number of files like this: :vimgrep /sometext/j **/*
After a couple or seconds of searching, the following error popped up:
Thanks for looking into it, and for creating this awesome plugin!
This can occur when too many files are opened at once because a hexokinase process is started for each file. :vimgrep
seems to create unlisted buffers for each result so this is what's causing the too many files open. Two solutions would be to modify let g:Hexokinase_refreshEvents
(to only check non-unlisted buffers) or to create a queue to cap the number of hexokinase processes started at once. In the meantime, a quickfix you might want to try is using let g:Hexokinase_ftDisabled
or let g:Hexokinase_ftEnabled
to restrict what type of files are parsed.
Thanks, it would make sense not to start a hexokinase process for unlisted buffers.
I'm using let g:Hexokinase_ftEnabled = ['css', 'html', 'scss']
for now and the error no longer appears for the projects I'm searching in :)
Yea the problem with that is determining when it stops being unlisted, currently there are no autocmd-events for this. 🤔
I saw this issue today. It is not a big project. There is only 1 lua file with 20 lines....
Error executing vim.schedule lua callback: Vim(let):E903: Process failed to start: too many open files: "/Users/rayx/.local/share/nvim/site/pack/packer/start/vim-hexokinase/hexokinase/hexokinase"
Does it consistently error on this single file or was it a one-off? Also, did the output of :ls
only have the single file?
I only saw it twice so far and will try to capture more info when I saw it next time. It might be the LSP server parser trying to open buffers in the background.