From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/59868 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: vim syntax highlighting in MKIV Date: Sun, 27 Jun 2010 01:41:35 -0400 (EDT) Message-ID: References: <4C251E90.3050808@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1277617309 13979 80.91.229.12 (27 Jun 2010 05:41:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 27 Jun 2010 05:41:49 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Jun 27 07:41:47 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OSkck-0005Um-Te for gctc-ntg-context-518@m.gmane.org; Sun, 27 Jun 2010 07:41:46 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 31EC7C9B10; Sun, 27 Jun 2010 07:41:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id vYygZsmBUQmx; Sun, 27 Jun 2010 07:41:43 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8B455C9AFD; Sun, 27 Jun 2010 07:41:43 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id ACF0EC9AFD for ; Sun, 27 Jun 2010 07:41:42 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id XCbhKimpL2pj for ; Sun, 27 Jun 2010 07:41:39 +0200 (CEST) Original-Received: from hellskitchen.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.82]) by balder.ntg.nl (Postfix) with ESMTP id 698D0C9AF5 for ; Sun, 27 Jun 2010 07:41:39 +0200 (CEST) Original-Received: FROM [192.168.2.8] (c-76-28-91-31.hsd1.ct.comcast.net [76.28.91.31]) By hellskitchen.mr.itd.umich.edu ID 4C26E491.CFD58.15568 ; Authuser adityam; 27 Jun 2010 01:41:37 EDT In-Reply-To: User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:59868 Archived-At: On Sat, 26 Jun 2010, Aditya Mahajan wrote: > Almost all the errors in t-vim over the years have due to trying to support > kpse: directive. (The errors were not a fault of ConTeXt, but the way quotes > are handled by cmd.exe and the various shells in *nix. I still haven't > figured out a syntax that works with all shells). This makes me wonder > whether it was a good idea to make vim module work out of the box. Perhaps a > more robust alternative was to ask the uses to copy 2context.vim to > $HOME/.vim/scripts/ and forget about getting mtxrun to locate the file. What > do others think? In the spirit of MkIV, I have attempted to redo the vim module from scratch. http://github.com/adityam/filter Download t-vim.tex t-filter.tex and 2context.vim. For testing just place them in the current directory. This new version is delegates the task of creating external files and running vim to get syntax highlighting to t-filter. It reads the file under a restrictive catcode regime... so 2context.vim only has to escape a few characters: \ { }, everything else has a catcode other (except space and newline which are active). Currently, this new module only supports * syntax highlighting (syntax=filetype) * two color schemes (alternative=pscolor and alternative=blackandwhite) * specifying start and stop lines (start=... , stop=...) An additional feature is that the module stores the md5 sums of all files, and runs vim only if the file has changed. So, this should be significantly faster than the old module. Difference * No \typevimfile... instead \definevimtyping[whatever] creates a command \typewhateverfile that can be used as \typewhateverfile[options][file] * Currently, no support for line numbering, although that should be easy to add now. * No support for active spaces yet. * Most importantly, this only runs under MkIV. That is because \doprocesslocalsetups is not defined in MkII. Hans, can you add the definition of \doprocesslocalsetups to MkII? I have only tested on linux. Testing on other platforms will be appreciated (Just run the files under test/vim/). Aditya ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________