Repository: lervag/vimtex

Issue #586: vimtex fails to load
Created: 2016-10-04T17:07:35Z
(This is probably the same issue as here, but I didn't want to necrobump a closed issue.)
vimtex fails to load
Problem. vimtex "loads" in the sense that it's added to 'runtimepath'; however, none of the commands, mappings, etc. are available. Only the documentation (e.g. :h vimtex) is available. Note that all other plugins (including LaTeX-Box, before I switched) work just fine, but even when I remove all plugins, vimtex still doesn't work.
Environment. I am using vim8's native package management system: all plugins that should be autoloaded go in ~/.vim/pack/my-plugins/start/, and all plugins that are optionally loaded go in ~/.vim/pack/my-plugins/opt/ and are manually added with :packadd. The issue persists regardless of whether vimtex is autoloaded in start/ or manually loaded from opt/ with :packadd. For the illustration below, let's assume vimtex is the only plugin in start/.
Steps to reproduce.

Open minimal working example using minimal vimrc.
Expected behavior: vimtex commands, mappings, etc. should all be available.
Observed behaviour: they're not available; only the documentation is (i.e. :h vimtex works).

Note that set filetype? correctly shows filetype=tex, and set 'runtimepath'? shows that vimtex is in fact "loaded", which explains why the documentation is available, but for some reason everything else is unavailable.
Hack solution. Running :call vimtex#init() makes vimtex work just fine.
Minimal working example
\documentclass{minimal}
\begin{document}

Hello World!

\end{document}
Minimal vimrc file
set nocompatible
filetype plugin indent on
syntax enable
Minimal vim directory
$ cd ~/.vim
$ ls
pack/ vimrc
$ tree pack
pack
└── my-plugins
    ├── opt
    └── start
        └── vimtex
            ├── after
            │   └── syntax
            │       └── tex.vim
            ├── autoload
            ...

Duplicate issue #645: Compatibility with Vim8's package system
Created: 2016-12-20T15:40:42Z
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.

Steps to reproduce


locate vimtex in ~/.vim/pack/something/start/
add g:tex_flavor='latex' to your ~/.vimrc
Open some doc.tex object



Expected behaviour
Commands and localleader mappings should be set up.


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

Closing comment (2016-12-28T12:26:06Z): 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.