Vimtex: SumatraPDF, gvim configuration and Windowsx64

Created on 3 Apr 2016  路  4Comments  路  Source: lervag/vimtex

vimtex says SumatraPDF is not executable

So I installed vimtex via Vundle, and everytime I create or try to modify any *.tex I am greeted by

Error detected while processing function vimtex#init..<SNR>42_init_modules..vimt
ex#view#init_buffer..28:
line   18:
vimtex viewer is not executable!
line   19:
g:vimtex_view_general_viewer = SumatraPDF

So I read the documentation and followed the instructions for setting Sumatra (I already checked that Sumatra is in my PATH). This is my vimrc

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=$HOME/vimfiles/bundle/Vundle.vim/

...
" Vim options

" tex file are always in latex
let g:tex_flavor='latex'
let g:vimtex_view_general_viewer = 'SumatraPDF' 
let g:vimtex_view_general_options='-reuse-instance -forward-search @tex @line @pdf'
let g:vimtex_view_general_options_latexmk='-reuse-instance'

I'm still getting the same errors. Any help? Again thanks

P.s running echo executable("Sumatrapdf") returns 0, the following :! Sumatrapdf opens sumatra.

Most helpful comment

@Davidnet Could you clarify how to "add to Path in text settings"? Do you mean some Vim specific settings for environmental variables native to itself?

I am having exactly the same problem (where SumatraPDF's path "C:\Program Files\SumatraPDF" has been added to the system Path), but keeps getting such error. And, my Vim setting should be the same across three Windows machine (running almost exactly the same configuration), and I only get such error warning from one of the machine.

All the best,

-Linfeng

All 4 comments

Solved: For strange reason if I added Sumatrapdf to the PATH via windows settings vim cannot locate sumatra, but if you add to Path in text settings, now vim can see it.

Strange. Happy to see that you managed to solve the problem yourself!

@Davidnet Could you clarify how to "add to Path in text settings"? Do you mean some Vim specific settings for environmental variables native to itself?

I am having exactly the same problem (where SumatraPDF's path "C:\Program Files\SumatraPDF" has been added to the system Path), but keeps getting such error. And, my Vim setting should be the same across three Windows machine (running almost exactly the same configuration), and I only get such error warning from one of the machine.

All the best,

-Linfeng

@Davidnet Could you clarify how to "add to Path in text settings"? Do you mean some Vim specific settings for environmental variables native to itself?

Ironically, I kept a OneDrive directory in my Path and there is a SumatraPDF.exe executable dangling for years. This file is not all "runnable" by itself, but its existence shall _fool_ gvim.exe when it tries to look up SumatraPDF in Path.

Removing this carelessly placed executable file helped Vim to source for the "locally installed" SumatraPDF.exe through a separately specified entry in the Path environmental variable.

Was this page helpful?
0 / 5 - 0 ratings