Closed jackkinsella closed 4 years ago
Update: Found the interaction plugin: tpope/vim-bundler
. When I comment that out, everything is lightning fast again.
Parsing a large Gemfile.lock
can indeed take some time, and rails.vim forces it to be eager. We already cache the hell out of it, so it only happens on loading the first file, or when the lock file changes.
Long term, this can be sped up by using Vim 9's faster function definitions, but if you're on nvim it'll probably be a while before you can reap the benefits of that. I don't have another suggestion other than to disable bundler.vim, although that will reduce functionality.
That BufEnter
event does very little and is probably a red herring. The FileType
event is where the real work is happening.
In a mid-sized Rails project, when I ran
nvim . --startuptime /tmp/vim.log
, I got the following standout entryRunning
:au BufEnter
in vim revealed the following callersI noticed that if I removed
vim-rails
the startup time became fast again, with theBufEnter
bit going down over 10x to102.469
.When I remove all plugins except vim-rails, everything is also super fast. So the issue is an interaction effect between this plugin and some other(s).
I'm happy to investigate myself but I thought I'd post in case you've any pointers on what would be worthwhile for me to look at.