-2

i try to

:! pdflatex file.tex && xdg-open file.pdf

in a general way with the '%' command, how to chanche the extension .tex to .pdf in vim using regexp?

:! pdflatex % && xdg-open ??
Andy Rufasto
  • 1
  • 1
  • 2

1 Answers1

0

You can use :r or < with % (current file name) to remove the extension.

:!pdflatex % && xdg-open %<.pdf

For more help see:

:h c_%
:h filename-modifiers
Peter Rincker
  • 43,539
  • 9
  • 74
  • 101