Vim: insert mode is very slow with 400+ lines
In my case relative numbers with same file opened in multiple windows was lagging. I had to do either :set norelativenumber
or close another windows.
Okay, folding was the problem here (I had some bad settings for foldlevelstart
). So, based on my experiences and these issues:
set foldenable " can slow Vim down with some plugins
set foldlevelstart=99 " can slow Vim down with some plugins
set foldmethod=syntax " can slow Vim down with some plugins
Other things to check/toggle are syntax
, filetype
, wrap
and line length (some plugins can be slow with very long lines).
Running Vim without your current settings is a good starting point. Thanks to @Frederik for pointing me to this:
vim -u NONE
After this, disabling all plugins is a good start. See also for general knowledge: :help slow
I recently came across this exact problem - lag while typing at the bottom of a relatively short (markdown) file. After uninstalling plugins and commenting out most of the settings in my .vimrc, I discovered that the issue was markdown folding coming from the vim-markdown plugin that is pre-installed with vim. Commenting out let g:markdown_folding = 1
did the trick.
I still wanted to have automatic folding on markdown files, so I installed vim-markdown-folding and there are no issues with performance.