Skip to content
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

Variables are Not Defined Correctly at Initialization when Using the "General" Viewer #183

Closed
gkapfham opened this issue Jun 9, 2015 · 1 comment

Comments

@gkapfham
Copy link

gkapfham commented Jun 9, 2015

I am running the most recent version of vimtex and I have discovered an issue when you do not specify a specific viewer such as Zathura. For instance, suppose that you have a minimal working example in the file minimal.tex that has the following contents:

\documentclass{minimal}
\begin{document}
Hello world first page!
\newpage
Hello world second page!
\newpage
\input{sections/first.tex}
\end{document}

In this case, the sections/first.tex file contains the following contents:

% vim: ft=tex
% !TEX root = minimal.tex
% mainfile: ../minimal.tex

Hello world third page!!

I am going to write a lot of content now. Does this work?

Additionally, I have configured the vimrc file to have these contents:

set nocompatible
filetype plugin indent on
syntax enable
set iskeyword+=:
set hidden

" change the mapleader from \ to , -- this makes it easier to perform compilation in LaTeX
let maplocalleader=","
let mapleader=","

call plug#begin('~/.vim/bundle')
Plug 'https://github.com/lervag/vimtex.git', {'for': 'tex'}
call plug#end()

" Starting to use vim-latex and it needs several configurations to work correctly
let g:vimtex_latexmk_options="-pdf -pdflatex='pdflatex -file-line-error -shell-escape -synctex=1'"
let g:vimtex_fold_enabled = 0
let g:vimtex_quickfix_mode = 2
let g:vimtex_quickfix_open_on_warning = 1
let g:vimtex_toc_resize = 0
let g:vimtex_toc_hide_help = 1
let g:vimtex_indent_enabled = 1
let g:vimtex_latexmk_enabled = 1
let g:vimtex_latexmk_callback = 1
let g:vimtex_complete_recursive_bib = 0
" let g:vimtex_view_method = 'zathura'

Please notice that the vimtex_view_method is commented out and thus vimtex should use the general approach as the default. Since I am using Ubuntu 14.04 LTS, this means that I will be running xdg-open when I run the \ll command for the minimal.tex file.

While vimtex's main features seem to work correctly, I have noticed that it produces the following error messages every time I attempt to use the general method for viewing:

Error detected while processing function vimtex#init..<SNR>34_init_modules..vimtex#view#init_buffer..4:
line    1:
E121: Undefined variable: g:vimtex_view_general_viewer
E116: Invalid arguments for function executable(g:vimtex_view_general_viewer)
E15: Invalid expression: !executable(g:vimtex_view_general_viewer)
Error detected while processing function vimtex#init..<SNR>34_init_modules..vimtex#view#init_buffer:
line   18:
E121: Undefined variable: g:vimtex_view_general_hook_view
E15: Invalid expression: '*' . g:vimtex_view_general_hook_view
line   20:
E121: Undefined variable: hookfunc
E116: Invalid arguments for function exists(hookfunc)
E15: Invalid expression: exists(hookfunc)
line   18:
E121: Undefined variable: g:vimtex_view_general_hook_callback
E15: Invalid expression: '*' . g:vimtex_view_general_hook_callback
line   20:
E121: Undefined variable: hookfunc
E116: Invalid arguments for function exists(hookfunc)
E15: Invalid expression: exists(hookfunc)
Error detected while processing FileType Auto commands for "*":
E117: Unknown function: UltiSnips#FileTypeChanged

Can any other users of vimtex confirm this issue? Additionally, @lervag, can you let me know if you can reproduce this and, if you can, then do you have an idea for a fix? If I have overlooked a new configuration variable that is now required, please let me know. Overall, any help that you can provide is greatly appreciated!

@lervag lervag closed this as completed in 692df6c Jun 10, 2015
@lervag
Copy link
Owner

lervag commented Jun 10, 2015

The bug was introduced due to a commit for #180, but it should be fixed now. I forgot to test all the viewers before committing. Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants