Search code examples
vimpluginslatexlatex-suite

Errors when opening vim after latex-suite installation


I tried to install the latex-suite plugin for vim and extracted it in ~/.vim/plugin/vim-latex. I added the recommended lines (as described here) to my .vimrc, but still have a couple of issues with it. I do not want to use gvim, but I am not sure, whether the plugin works with vim. Since I've installed the plugin the following errors occur whenever I open vim:

E121: Undefined variable: g:Tex_FontMaps
E15: Invalid expression: !exists('s:doneOnce') && g:Tex_FontMaps
line   11:
E121: Undefined variable: g:Tex_Menus
E15: Invalid expression: g:Tex_Menus && g:Tex_FontMenus
line    4:
E121: Undefined variable: g:Tex_FontMaps
E15: Invalid expression: !exists('s:doneOnce') && g:Tex_FontMaps
line   11:
E121: Undefined variable: g:Tex_Menus
E15: Invalid expression: g:Tex_Menus && g:Tex_FontMenus
line    4:
E121: Undefined variable: g:Tex_FontMaps
E15: Invalid expression: !exists('s:doneOnce') && g:Tex_FontMaps
line   11:
E121: Undefined variable: g:Tex_Menus
E15: Invalid expression: g:Tex_Menus && g:Tex_FontMenus
line    4:
E121: Undefined variable: g:Tex_FontMaps
E15: Invalid expression: !exists('s:doneOnce') && g:Tex_FontMaps
line   11:
E121: Undefined variable: g:Tex_Menus
E15: Invalid expression: g:Tex_Menus && g:Tex_FontMenus
line    4:
E121: Undefined variable: g:Tex_FontMaps
E15: Invalid expression: !exists('s:doneOnce') && g:Tex_FontMaps
line   11:
E121: Undefined variable: g:Tex_Menus
E15: Invalid expression: g:Tex_Menus && g:Tex_FontMenus
line    4:
E121: Undefined variable: g:Tex_FontMaps
E15: Invalid expression: !exists('s:doneOnce') && g:Tex_FontMaps
line   11:
E121: Undefined variable: g:Tex_Menus
E15: Invalid expression: g:Tex_Menus && g:Tex_FontMenus
Error detected while processing /Users/fs/.vim/plugin/vim-latex/ftplugin/latex-suite/elementmacros.vim:
line  124:
E121: Undefined variable: g:Tex_FontMaps
E15: Invalid expression: g:Tex_FontMaps | exe ``vnoremap <silent> ''.g:Tex_Leader.``em \<C-\\>\<C-N>:call VEnclose('\\emph{', '}', '{\\em', '\\/}')<CR>'' | endif
line  125:
E121: Undefined variable: g:Tex_FontMaps
E15: Invalid expression: g:Tex_FontMaps | exe 'call IMAP (``FEM'', ``\\emph{<++>}<++>'', ``tex'')' | endif
line  128:
E121: Undefined variable: g:Tex_Menus
E15: Invalid expression: g:Tex_Menus && g:Tex_FontMenus
line  171:
E121: Undefined variable: g:Tex_Menus
E15: Invalid expression: g:Tex_Menus
line  248:
E121: Undefined variable: g:Tex_Menus
E15: Invalid expression: g:Tex_Menus
line  311:
E121: Undefined variable: g:Tex_Menus
E15: Invalid expression: g:Tex_Menus
line  324:
E121: Undefined variable: g:Tex_CatchVisMapErrors
E15: Invalid expression: g:Tex_CatchVisMapErrors
Error detected while processing /Users/fs/.vim/plugin/vim-latex/ftplugin/latex-suite/envmacros.vim:
line    9:
E121: Undefined variable: g:Tex_EnvironmentMaps
E15: Invalid expression: !g:Tex_EnvironmentMaps && !g:Tex_EnvironmentMenus
Error detected while processing /Users/fs/.vim/plugin/vim-latex/ftplugin/latex-suite/wizardfuncs.vim:
line  209:
E117: Unknown function: Tex_MakeMap
line  210:
E117: Unknown function: Tex_MakeMap
line  306:
E121: Undefined variable: g:Tex_Leader2
E15: Invalid expression: ''.``\n Environment shortcuts''.``\n <mapleader> is a value of g:Tex_Leader2''.``\n I     v&V                       I     v&V''.``\n ELI   ''.g:Tex_Leader2.``li   list                EQN   ''.g:Tex_Leader2.``qn   quotation''.``\n EDE   ''.g:Tex_Leader2.``de   description         ESP   ''.g:Tex_Leader2.``sb   sloppypar''.``\n EEN   ''.g:Tex_Leader2.``en   enumerate           ETI   ''.g:Tex_Leader2.``ti   theindex''.``\n EIT   ''.g:Tex_Leader2.``it   itemize             ETP   ''.g:Tex_Leader2.``tp   titlepage''.``\n ETI   ''.g:Tex_Leader2.``ti   theindex            EVM   ''.g:Tex_Leader2.``vm   verbatim''.``\n ETL   ''.g:Tex_Leader2.``tl   trivlist            EVE   ''.g:Tex_Leader2.``ve   verse''.``\n ETE   ''.g:Tex_Leader2.``te   table               ETB   ''.g:Tex_Leader2.``tb   thebibliography''.``\n ETG   ''.g:Tex_Leader2.``tg   tabbing             ENO   ''.g:Tex_Leader2.``no   note''.``\n ETR   ''.g:Tex_Leader2.``tr   tabular             EOV   ''.g:Tex_Leader2.``ov   overlay''.``\n EAR   ''.g:Tex_Leader2.``ar   array               ESL   ''.g:Tex
line  324:
E121: Undefined variable: g:Tex_Leader
E15: Invalid expression: ''.``\n Font shortcuts''.``\n <mapleader> is a value of g:Tex_Leader''.``\n Shortcuts         Effects''.``\n I        v&V      I&v               V''.``\n FBF      ''.g:Tex_Leader.``bf      \\textbf{}         {\\bfseries }''.``\n FMD      ''.g:Tex_Leader.``md      \\textmd{}         {\\mdseries }''.``\n''.``\n FTT      ''.g:Tex_Leader.``tt      \\texttt{}         {\\ttfamily }''.``\n FSF      ''.g:Tex_Leader.``sf      \\textsf{}         {\\sffamily }''.``\n FRM      ''.g:Tex_Leader.``rm      \\textrm{}         {\\rmfamily }''.``\n''.``\n FUP      ''.g:Tex_Leader.``up      \\textup{}         {\\upshape }''.``\n FSL      ''.g:Tex_Leader.``sl      \\textsl{}         {\\slshape }''.``\n FSC      ''.g:Tex_Leader.``sc      \\textsc{}         {\\scshape }''.``\n FIT      ''.g:Tex_Leader.``it      \\textit{}         {\\itshape }''
line  337:
E121: Undefined variable: g:Tex_Leader2
E15: Invalid expression: ''.``\n Section shortcuts''.``\n <mapleader> is a value of g:Tex_Leader2''.``\n I     v&V''.``\n SPA   ''.g:Tex_Leader2.``pa   part''.``\n SCH   ''.g:Tex_Leader2.``ch   chapter''.``\n SSE   ''.g:Tex_Leader2.``se   section''.``\n SSS   ''.g:Tex_Leader2.``ss   subsection''.``\n SS2   ''.g:Tex_Leader2.``s2   subsubsection''.``\n SPG   ''.g:Tex_Leader2.``pg   paragraph''.``\n SSP   ''.g:Tex_Leader2.``sp   subparagraph''
Error detected while processing function <SNR>25_Tex_SpecialMacros:
line    7:
E121: Undefined variable: g:Tex_EnvMenuLocation
E15: Invalid expression: g:Tex_EnvMenuLocation.a:submenu.a:name
line   29:
E121: Undefined variable: g:Tex_Menus
E15: Invalid expression: g:Tex_Menus && g:Tex_EnvironmentMenus
line    7:
E121: Undefined variable: g:Tex_EnvMenuLocation
E15: Invalid expression: g:Tex_EnvMenuLocation.a:submenu.a:name
line   29:
E121: Undefined variable: g:Tex_Menus
E15: Invalid expression: g:Tex_Menus && g:Tex_EnvironmentMenus
line    7:

Some of the shortcuts work in vim (for example the F5 key), but others do not (for example `p in a math environment should change to \pi). When I hit \ll it tries to generate the pdf, but the following errors occur:

Error detected while processing function Tex_RunLaTeX:
line    7:
E121: Undefined variable: s:target
E15: Invalid expression: s:target
line   10:
E121: Undefined variable: s:target
E116: Invalid arguments for function Tex_Debug
line   12:
E121: Undefined variable: s:target
E116: Invalid arguments for function Tex_GetVarValue('Tex_FormatDependency_'.s:target) != ''
E15: Invalid expression: Tex_GetVarValue('Tex_FormatDependency_'.s:target) != ''
line   21:
E121: Undefined variable: dependency
E116: Invalid arguments for function Tex_Debug
line   25:
E121: Undefined variable: dependency
E116: Invalid arguments for function Tex_Strntok(dependency, ',', i) != ''
E15: Invalid expression: Tex_Strntok(dependency, ',', i) != ''
line   51:
E121: Undefined variable: initTarget
E15: Invalid expression: initTarget
Press ENTER or type command to continue

Here are the other plugins that I am using in vim:

Plugin 'gmarik/Vundle.vim' `` let Vundle manage Vundle, required
Plugin 'L9'
'' Plugin 'git://git.code.sf.net/p/atp-vim/code' `` vim latex automatic
'' Plugin 'the-nerd-tree' `` nerdTree
Plugin 'tomtom/tcomment_vim' '' toggle comment
Plugin 'Lokaltog/vim-easymotion' ``easy motion plugin <leader><leader>w
Plugin 'tpope/vim-surround' ''surround plugin
`` Plugin 'LaTeX-Box-Team/LaTeX-Box' ''latex plugin
Plugin 'ervandew/supertab' ``supertab 
Plugin 'yegappan/mru' ''MRU (most recently used) 
Plugin 'kien/ctrlp.vim' `` Control P search
Plugin 'plasticboy/vim-markdown' '' markdown syntax highlighting
Plugin 'Raimondi/delimitMate' `` auto complete for brackets and stuff
Plugin 'altercation/vim-colors-solarized' '' solarized color scheme
Plugin 'scrooloose/syntastic' ``syntax check for a bunch of different languages
Plugin 'bling/vim-airline' ''fancy status line
Plugin 'tpope/vim-fugitive'

Solution

  • The location ~/.vim/plugin/vim-latex is wrong. Either directly unzip the plugin to ~/.vim/, so that the Vimscript files are placed into the appropriate plugin autoload etc. subdirectories, or use Vundle to install and manage the plugin.

    The errors are caused by the fact that the plugin configuration didn't execute, so the other parts of the plugin complain about missing config.