lervag / vimtex

VimTeX: A modern Vim and neovim filetype plugin for LaTeX files.
MIT License
5.51k stars 389 forks source link

Compatibility with Vim8's package system #645

Closed lgalke closed 7 years ago

lgalke commented 7 years ago

Recently, I adapted my submodular pathogen architecture to match the recent package system of Vim8. Thus i moved vimtex plugin to ~/.vim/pack/extra/start/vimtex. But unfortunately, the plugin's functionality is missing, while the scripts are loaded ( in scriptnames ). I found out that the traditional way of a bundle subdirectory inside ~/.vim and adding this via execute pathogen#infect() does still work.

  1. Steps to reproduce

    • locate vimtex in ~/.vim/pack/something/start/
    • add g:tex_flavor='latex' to your ~/.vimrc
    • Open some doc.tex object
  2. Expected behaviour Commands and localleader mappings should be set up.

  3. Observed behaviour No commands and localleader mappings are set up. For syntax, $\alpha$ gets replaced (Still, I am not sure whether this is done by vimtex or plain tex ftplugin). However :scriptnames does contain vimtex's ftplugin:

    76: ~/git/veight/vim/pack/extra/start/vimtex/ftplugin/tex.vim¶
    78: ~/git/veight/vim/pack/extra/start/vimtex/after/syntax/tex.vim¶
    83: ~/git/veight/vim/pack/extra/start/vimtex/indent/tex.vim¶

    I also tried to reload the buffer via :e % or fire some autocommands :doautocmd BufReadPost, but this did not help either.

I do not have any .latexmk file and exclude all further (except for g:tex_flavor) option customization for vimtex from my vimrc. Other plugins are assumed to not interfere, since the usual pathogen+bundle/vimtex way does still work.

Im not 100% sure whether vim's packages can also deal with autoload/vimtex directory. This might be my first guess why it does not work.

Would be great to see a fix :)

Best Regards, Lukas Galke

lervag commented 7 years ago

I am curious if this could be related to #586. Could you read through the issue comments and see if something there might help?

I personally use vim-plug, but I did test once that the Vim 8 package system should work correctly. It did for me when I tested.

lgalke commented 7 years ago

I must have missed a notification here, yes this perfectly describes the behaviour I was also experiencing. For another plugin, I also noticed that internal vim files get sources before e.g. b:did_indent was set by internal indent/python.vim before pep8 indent could happen. I fixed it by branching and brute-force renaming the guard variable. But I was not aware that this behaviour is 1. caused by symlinking .vim and 2. also causes vimtex's init to break. Thanks a lot.

lervag commented 7 years ago

No problem! :)