1

I have used vim to make small scripts in python and typesetting things in LaTeX. So it is very useful to run applications from vim by typing :!python or :!pdflatex etcetera. But after upgrading to el capitan, this seems not to work anymore, get message like /bin/bash: pdflatex: command not found. But the funny thing is that it is possible to run the applications directly from terminal. Anyone that know how to set the correct that for vim as well?

Dyno Fu
  • 8,753
  • 4
  • 39
  • 64
nunatak
  • 143
  • 3

1 Answers1

0

$PATH variable not properly set in gvim/MacVim when it is opened from the finder first check :!echo $SHELL and see if SHELL is set to bash or not

then try to set your path in your ~/.bash_profile?

export PATH=<dir_contains_pdflatex>:$PATH
Community
  • 1
  • 1
Dyno Fu
  • 8,753
  • 4
  • 39
  • 64
  • Thanks! Typing `:!echo $SHELL` gives `/bin/bash`, tied to add `export PATH=/usr/local/texlive/2014/bin/x86_64-darwin/pdflatex:$PATH`, in `.bash_profile` but it seems to not fix the problem.... – nunatak Dec 08 '15 at 21:42
  • so you have restart macvim and `:!echo $PATH`, still the path does not include pdflatex? – Dyno Fu Dec 08 '15 at 22:00
  • i do have tried on my own system and seems it works fine - add some directory to PATH in `.bash_profile`, then restart macVim and `:echo $PATH` it's there ... – Dyno Fu Dec 08 '15 at 22:04
  • still get only `/bin/bash` – nunatak Dec 08 '15 at 22:11
  • what? `/bin/bash` is the `SHELL` not `PATH`. what is `PATH`? – Dyno Fu Dec 08 '15 at 22:12
  • Now everything is working perfect, i don't know what i did, but it have to be some of the instructions. Thanks a lot! – nunatak Dec 08 '15 at 22:18
  • `:!echo $PATH` gives `/Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/ bin:/opt/X11/bin:/Library/TeX/texbin` – nunatak Dec 08 '15 at 22:21
  • it looks ok to me. only problem is there should be no space between usr/local/ and bin. if pdflatex in `/Library/TeX/texbin`, then it should work. just try `:which pdflatex` – Dyno Fu Dec 08 '15 at 22:24
  • `/Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin//pdflatex ` so the problem could be wrong path in the first comment, sorry. It seems to work now, thanks! – nunatak Dec 08 '15 at 22:26
  • yes, as long as pdflatex in the PATH, it will work :) – Dyno Fu Dec 08 '15 at 22:28