-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ftplugin/**/*.vim don't load lazily #24
Comments
Hi, thanks for the report. Could you show me the content of a.log file after this command?
|
Okay, mine is here: http://bpaste.net/show/urXdxCbZJJsS0qgbz1ct/ https://github.com/opennota/dotfiles/blob/master/.vimrc#L152-L153 And by the way, which version of Vim are you running? |
I even tested with your .vimrc, but it seems to work fine, though I see an error:
|
Yes, I use slightly modified ultisnips (to get rid of this error). The same with these two lines removed, except that the following lines disappeared from the log:
|
vim --version
|
I renamed ~/.vim to .vim2 and did a clean :PlugInstall. Nothing changed. vim-plug is latest (commit 288a4f7). |
Thanks for clarification. I'm currently testing it on several different platforms. In the meantime, could you post the --startuptime log ( call plug#begin()
Plug 'fatih/vim-go', { 'for': 'go' }
call plug#end() |
plug.vim
.vimrc
command line
|
Oh, that's normal. That FileType event is what triggers vim-plug to load plugin files. I just reproduced the problem on Fedora. (It worked find on OSX and Ubuntu (12 & 14)) I'll fix the problem and let you know, thanks! |
It was caused by |
You might even want to skip loading /etc/vimrc if it doesn't contain something relevant. It will slightly reduce the startup time. http://superuser.com/questions/140913/how-to-start-vim-without-executing-etc-vimrc |
Excuse me, but now (after last commit 1d477a1)
(disable auto comment next line) works only if placed after
is this normal? |
@Gyrfalco Did it work before the commit? I tested without it (
|
@Gyrfalco Okay, I see the problem. It depends on whether you have |
If `filetype plugin on` is called before `plug#end()`, filetype plugin handler is invoked before ODL autocmd from vim-plug which updates runtimepath and ftplugin files are not loaded.
@opennota @Gyrfalco Could you test again with the latest version? |
I have |
@opennota 6 times? No. It is possible that it's called twice when vim-go is first loaded, but after that it should be loaded only once per the event. I downloaded your .vimrc and prepended |
Ah, it happens when I comment out the |
It is possible that the same autocmds are registered multiple times, check the output of augroup filetype_go
autocmd!
" ...
augroup END I'm still looking for a way to avoid double-loading of ftplugins at the first time a certain filetype is loaded, without breaking the use case of @Gyrfalco. |
No duplicate entries, while GoOptions() is called 6 times.
|
What happens when you open the 2nd go file? How many times does GoOptions get called then? |
@junegunn Without /etc/vimrc ( |
It is
that is called once for each following line:
5 + 1 = 6 |
Ah yes you're right. I just reverted a commit that inadvertently broke multiple plugins for the same type. I'll come up with a way to reduce the calls. |
This reverts commit a026eb3. Conflicts: plug.vim
@opennota @Gyrfalco Sorry for all the confusion. Please update and test it again. |
Works for me. Thank you! |
Thanks. I'll close this issue once @Gyrfalco confirms. We still have this one-time, double-loading problem though, which should be harmless, but mostly unnecessary. I'll create a separate issue for it. |
Works for me too! Thank you very much. |
Thank you for all the help! |
I found that I need to add
'ftplugin'
to the list of types in thes:lod_ft
function to make vim-go plugin work properly. Without it the:GoFmt
command was not available.My little knowledge of the vim internals doesn't allow me to make it a pull request. Can this change break something?
The text was updated successfully, but these errors were encountered: