# How to let minted highlight a whole file from disk

I am using the minted package to highlight source code in LaTeX. It works well for a piece of code embedded in \begin{minted} ... \end{minted}. Now the question is if it is possible to highlight a whole file whose path is specified in .tex. Going further, is it possible to let minted to choose an appropriated lexer to use in according to the suffix of a file?

-

Finally, there’s the comment \inputminted command to read and format whole files. Its syntax is \inputminted[options]{language}{filename}.
@SoftTimur Sorry, no, if I did I would have said so. I've never used minted. – Torbjørn T. Dec 14 '11 at 13:28
@SoftTimur: You could try to be clever with the \IfEndWith command of xstring or something like that, if you really can't select the lexer yourself every time. – You Dec 14 '11 at 14:11