GVim starts slowly with enable_for_buffer()
See original GitHub issueIf you’re having trouble with NCM2, Please provide the following information along with your detailed issue description:
OS
Windows 10 Pro 1803
neovim :version output
GVim 8.1 with patch 1-116
Minimal vimrc for reproducing the issue
set nocompatible
set fileformat=unix
set fileformats=unix,dos
set encoding=utf-8
call plug#begin('E:\ProgramFiles\Vim\vimfiles\plugged')
Plug 'ncm2/ncm2'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
call plug#end()
autocmd BufEnter * call ncm2#enable_for_buffer()
neovim :messages output when the error occurs
N/A.
Log files if you think the issue is a bug
gvim --startuptime log.txt
with and without the autocmd BufEnter * call ncm2#enable_for_buffer().
Additional description
In short, is there a solution to make this autocmd work without slowing down the startup?
Basically, with autocmd BufEnter * call ncm2#enable_for_buffer() in my full vimrc, it could take as much as about 2.6s to start GVim while it takes only about 500ms to start without this autocmd. However, it is necessary to put this autocmd in my vimrc since I usually load a session before working.
Startup timing log files of minimal vimrc are attached below. Thanks in advanced.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Speed up opening buffer (might be irrelevant) #53 - GitHub
The slow opening of the buffer is not caused by the plugin manager but is caused by the the VimEnter autocmd from some...
Read more >Vim slows down with multiple buffers etc
Try disabling vim-bufferline plugin. I see some performance issues on it's Github tracker. – grodzik. Dec 16, 2016 at 8:19.
Read more >How to speed up vim's buffer open? - Stack Overflow
How i can speed up buffer open for the first time? I find myself often use ctrl-p and load is very slow. Also...
Read more >Vim slow at rendering the buffer with LaTeX syntax highlighting
Try opening the file with: vim -u NONE filename.tex to disable your .vimrc and other scripts from loading for the session. If this...
Read more >Profiling Vim to Find Out Which Plugin Makes Vim Slow
Find out which plugin makes Vim slow to start You can profile the startup process of Vim by adding the --startuptime option during...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I believe I’m hitting the same issue, with neovim-gtk, except it straight up hits a timeout and shows an error message with
so it’s rather critical. Launching nvim in terminal works fine.
seems to work too but it’s a workaround.
Edit: turns out the
InsertEnterworkaround doesn’t work very well: it makes the LSP completions not show up until the language client is manually restarted (probably due to it initializing before ncm2). I switched to the timer workaround.Hmm…
If you don’t want ncm2 to start as vim starts.
Try something like
or