On Sat, 28 Apr 2007, Chris Rawnsley wrote:
Hello All, I am writing a project report for a PHP project I have completed and I need to include the code I have written. I would like to have code that is highlighted similar to the editor I use (it's Notepad2 but I'm sure most of you know what I mean), has line numbers and is in a monospaced font.
Now I know that ConTeXt itself doesn't have support for PHP highlighting but I have found something in the third party modules that is able to use ViM to do what I want. Unfortuantely, I can't get it to work, hence why I am here!
I'm on Windows XP and I am using the standalone ConTeXt distribution from the 22nd March 2007. When I came to install the module, I found that it was already included in the distribution. I have installed the distribution under C:\ConTeXt\ along with Perl (C:\perl\) and Ruby (C:\ruby\). What is non-standard in my setup is my own custom built batch file:
I'll put that in the directory of the .tex file I want to run it on. In this case it is "c_Implementation.tex". My implementation file looks like this:
\startcomponent c_Implementation \product ../prd_TennisClubBookingSystem \project ../../prj_School
You do not need to mention ../ and ../../. ConTeXt automatically searches for product and project files in one higher directory.
%%%%%%%%%%%%%%%%% % Setup Figures % %%%%%%%%%%%%%%%%% \setupexternalfigures[directory={Implementation/Figures,Figures}]
%%%%%%%%%%% % Content % %%%%%%%%%%% \chapter[cha:Implementation]{Implementation}
\setupcolors[state=start]
\definevimtyping [RUBY] [syntax=ruby] \startRUBY #! /usr/bin/ruby # This is my first ruby program puts "Hello World" \stopRUBY
And when I run my batch file on it, TeXexec returns the error: ! Undefined control sequence. l.36 \definevimtyping [RUBY] [syntax=ruby]
Do you have \usemodule[vim] somewhere in the setup? Does the log file say something like "module: ViM Syntax Highliting" What does texmfstart --locate 't-vim.tex' give?
I think where I am falling down is that ViM doesn't seem integrated to me. I have it placed under C:\Programs\ViM\ and I used the installer which has all the different types GUI and command line version as well. Do I need the set something up in the module to make it know where ViM is or do I need to somehow directly use ViM itself?
You need vim.exe to be in your PATH. Does texmfstart bin:vim start vim? Aditya