# Highlighting for viml in latex?

I want syntax highlighting for vim scripts in my latex document. So if I write

\begin{lstlisting}
autocmd FileType c setlocal expandtab shiftwidth=4 tabstop=4 softtabstop=4
\end{lstlisting}


it should highlight this viml source.

I googled around but did not get any good result, as google does not understand what I want. So maybe it is my fault because I don't know how to use google, or it is googles fault because it is not able to understand me. Are there any packages/settings/foobar which help me to do this?

-

## migrated from stackoverflow.comMay 16 '13 at 19:51

This question came from our site for professional and enthusiast programmers.

Maybe this could help you out? –  timss May 16 '13 at 16:31
Have a look at this. –  mrkva May 16 '13 at 20:42

Since vim scripts are not one of the the languages supported with a built-in analyzer in the listings package, you will have to:

1. Write an analyzer for listings,
2. Substitute another analyzer and tweak keywords (might the sh analyzer be adequate?),
3. Find a highlighter that will substitute in Latex. Minted/ Pygments doesn't support vim scripts, but it might be easier to write your own support, or
4. Switch to Context: Context's Vim module supports vim scripts; see http://tex.stackexchange.com/a/73109/175

For the fourth choice, in Context you might enter:

\usemodule[vim]
\definevimtyping[VIM][syntax=vim]

\starttext
\startVIM
autocmd FileType c setlocal expandtab shiftwidth=4 tabstop=4 softtabstop=4
\stopVIM
\stoptext

-
I made a minor improvement in the context code. I hope that you do not mind. –  Aditya Jun 16 '13 at 13:43