-
-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
vim-plugins: turn filetype and syntax before sourcing the plugins #77143
vim-plugins: turn filetype and syntax before sourcing the plugins #77143
Conversation
…ins (NixOS#66536)" This reverts commit a3bf0c2.
…utocmd (NixOS#76845)" This reverts commit fa92f00.
Please backport this to 19.09. |
It's possible that you're going to get into a tangle here: some plugin managers have the opposite requirement. Eg pathogen asks you to turn Good luck! |
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. |
3131b33
to
dba76a1
Compare
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[0]: The filetype and syntax are enabled *before* the plugins are loaded. - Pathogen[1]: The filetype and syntax are enabled *after* the plugins are loaded. - Plug[2]: The filetype and syntax are automatically enabled. [0]: https://github.com/MarcWeber/vim-addon-manager/tree/d9e865f3c2de5d9b7eabbc976f606cf1b89e29ea#recommended-setup [1]: https://github.com/tpope/vim-pathogen/blob/a553410f1bdb9000fbc764069f3a5ec3454a02bc/README.markdown#runtime-path-manipulation [2]: https://github.com/junegunn/vim-plug/blob/2f5f74e5e67f657e9fdac54891a76721bcd3ead3/README.md#usage
dba76a1
to
f18b391
Compare
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[2 built, 1 copied (32.4 MiB), 6.8 MiB DL]
https://github.com/NixOS/nixpkgs/pull/77143
1 package built:
vimPlugins.vim-terraform
@GrahamcOfBorg build vimPlugins.vim-terraform |
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
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @timokau @gloaming