Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
vim-plugins: turn filetype and syntax before sourcing the plugins #77143
Motivation for this change
Currently, all the plugins are loaded after all the plugins have already been loaded. This could break some plugins, for instance, vim-terraform assumes the filetype detection has already been enabled.
This commit follows VAM's recommendation and enables filetype and syntax before sourcing any of the plugins.
This was discovered after a follow up with vim-terraform's maintainer on an upstream pull request: hashivim/vim-terraform#133
Ah, thank you for pointing that out @dimbleby. I removed vundle and neobundle since they're not actually implemented and will probably include the settings directly with the plugin implementation for this to work correctly.
Currently, all the filetype and syntax are enabled *after* all the plugins has already been loaded. Whilst this is the case for Pathogen, it's not recommended when using VAM. This commit applies the recommendation for: - VAM: The filetype and syntax are enabled *before* the plugins are loaded. - Pathogen: The filetype and syntax are enabled *after* the plugins are loaded. - Plug: The filetype and syntax are automatically enabled. : https://github.com/MarcWeber/vim-addon-manager/tree/d9e865f3c2de5d9b7eabbc976f606cf1b89e29ea#recommended-setup : https://github.com/tpope/vim-pathogen/blob/a553410f1bdb9000fbc764069f3a5ec3454a02bc/README.markdown#runtime-path-manipulation : https://github.com/junegunn/vim-plug/blob/2f5f74e5e67f657e9fdac54891a76721bcd3ead3/README.md#usage
I tested the following implementation with the
All the above-compiled vim were then tested by opening a Terraform file, I see no errors and the filetype is set correctly to
I was not able to verify that vim-terraform is able to load correctly with the native plugins (I'm not sure how that even works), so I left that implementation unchanged by adding the
Didn't you open a similar PR already? This all seems very familiar to me.
Unfortunately I'm pretty short on time currently, so I can't test this extensively. I'm not entirely sure if turning both of these on is the right thing to do, but I'll let you and the other people interested in vim decide here.