From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/21286 Path: news.gmane.org!not-for-mail From: "Thomas A. Schmitz" Newsgroups: gmane.comp.tex.context Subject: Re: TeX + Metapost syntax highlighting in Vim Date: Fri, 8 Jul 2005 19:48:36 +0200 Message-ID: <0C3F4C18-2C33-4466-8922-A931603585DD@uni-bonn.de> References: <42CEA592.8010603@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v730) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1120845002 8761 80.91.229.2 (8 Jul 2005 17:50:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 8 Jul 2005 17:50:02 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Jul 08 19:49:59 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dqwz0-0003ou-2q for gctc-ntg-context-518@m.gmane.org; Fri, 08 Jul 2005 19:49:50 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B5F6A12895; Fri, 8 Jul 2005 19:49:48 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 15201-03; Fri, 8 Jul 2005 19:49:42 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6CE9E1288B; Fri, 8 Jul 2005 19:49:42 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 055F21288B for ; Fri, 8 Jul 2005 19:49:41 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 15162-03-2 for ; Fri, 8 Jul 2005 19:49:39 +0200 (CEST) Original-Received: from mailout04.sul.t-online.com (mailout04.sul.t-online.com [194.25.134.18]) by ronja.ntg.nl (Postfix) with ESMTP id CC56912883 for ; Fri, 8 Jul 2005 19:49:39 +0200 (CEST) Original-Received: from fwd17.aul.t-online.de by mailout04.sul.t-online.com with smtp id 1Dqwym-0005uU-02; Fri, 08 Jul 2005 19:49:36 +0200 Original-Received: from [192.168.0.2] (rPdStiZ68eFuIkKinvSwJqG9LLvrclSU1Or7Fx9yGjIxjnu7JNh6QB@[84.177.97.179]) by fwd17.sul.t-online.de with esmtp id 1DqwyF-1mIXHE0; Fri, 8 Jul 2005 19:49:03 +0200 In-Reply-To: <42CEA592.8010603@gmail.com> Original-To: mailing list for ConTeXt users X-Mailer: Apple Mail (2.730) X-ID: rPdStiZ68eFuIkKinvSwJqG9LLvrclSU1Or7Fx9yGjIxjnu7JNh6QB@t-dialin.net X-TOI-MSGID: ecfabd9d-28ac-4a08-9386-7af93377ec05 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 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 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:21286 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:21286 Mojca, just wonderful to see that there's another ConTeXt user who likes vim! Though I'm basically an emacs person, there are some editing tasks I like to do with vim - the line numbering alone is wonderful, there is no equivalent in emacs (and I've tried quite a lot of things!). So cheers to you. So far, I've basically been working with vim-latex, gnashing my teeth from time to time (oh the way they hijacked the alt key!). I've just added support for typesetting with texexec by adding this line to texrc: TexLet g:Tex_CompileRule_cont = 'texexec --pdf --nonstopmode $*' But I for one would be extremely happy if someone more knowledgeable would add proper ConTeXt support to vim the way Berend and Patrick added ConTeXt support to AucTeX! Best Thomas On Jul 8, 2005, at 6:10 PM, Mojca Miklavec wrote: > > In case someone finds this experimental piece of code for > highlighting metapost inside ConTeXt useful, put: > > " ConTeXt > augroup filetypedetect > au! BufRead,BufNewFile *.tex setfiletype context > augroup END > > somewhere to your filetype.vim (probably after TeX) and move the > attached file to syntax\context.vim. > > If you have something like > \startMPpage > draw ... > \stopMPpage, > it will do the syntax highligting for metapost inside the \start- > \stop pair. > > There are still some "bugs" present (see comments in file), but I > don't know how yet to get rid of them. > > I downloaded SpellChecker and SuperTab (autocomplete) today from > the vim website and it works great! (see http://contextgarden.net/ > Vim and feel free to add any useful stuff there) > > I was astonished as I saw autocomplete work. There are only a > couple of lines with an extraordinary functionality. I think that > if someone writes a good script to convert texshow to vim syntax > highlighting script, than autocomplete will be able to provide good > hints for all the existing commands in ConTeXt and the > corresponding parameters. I'll try to see what I can do, but please > don't excpect any results too soon. > > Mojca > " Vim syntax file > " Language: ConTeXt > " Maintainer: Mojca Miklavec > " Installation: > " To automatilcally load this file when a .tex file is opened, > add the > " following lines to ~/.vim/filetype.vim: > " > " augroup filetypedetect > " au! BufRead,BufNewFile *.tex setfiletype context > " augroup END > " > " You will have to restart vim for this to take effect. In any > case it > " is a good idea to read ":he new-filetype" so that you know > what is going > " on, and why the above lines work. > > " Adapted from eruby by Michael Brailsford (Thanks for the idea!) > " > " This is just a testing version. > " TODO: > " - adapt tex.vim for plain TeX + ConTeXt support only (no > LaTeX!!!) > " - add MetaFun support on the top of Metapost > " - add all the possible \start ... \stop delimiters which > switch the > " syntax highlighting to MetaFun, XML, JavaScript, ... > " > if version < 600 > syntax clear > elseif exists("b:current_syntax") > finish > endif > > "Source the tex syntax file > runtime! syntax/tex.vim > "Set the filetype to tex to load the tex %??? ftplugins > set ft=tex > unlet b:current_syntax > > " Put the metafun syntax file in @metafunTop > " > " TODO: should be changed to metafun once the support is there > " javascript should probably be adapted to PDF specification too, > but it > " changes in every version anyway and doesn't work either > " > syn include @metafunTop syntax/mp.vim > " for some reason I can't make both metapost and javascript working > at the same time > "syn include @javascriptTop syntax/javascript.vim > > syn region metafunBlock matchgroup=metafunDelim start=#\ > \startMPpage# end=#\\stopMPpage# keepend contains=@metafunTop > " TODO: \startuseMPgraphic{the name} - "the name" has to be catched > and > " typeset in ConTeXt, not in metapost!!! > " \start..MP.. may not be inside comments!!! > syn region metafunBlock matchgroup=metafunDelim start=#\ > \startMPinclusions# end=#\\stopMPinclusions# keepend > contains=@metafunTop > syn region metafunBlock matchgroup=metafunDelim start=#\ > \startMPgraphic# end=#\\stopMPgraphic# keepend contains=@metafunTop > syn region metafunBlock matchgroup=metafunDelim start=#\ > \startuseMPgraphic# end=#\\stopuseMPgraphic# keepend > contains=@metafunTop > syn region metafunBlock matchgroup=metafunDelim start=#\ > \startreusableMPgraphic# end=#\\stopreusableMPgraphic# keepend > contains=@metafunTop > syn region metafunBlock matchgroup=metafunDelim start=#\ > \startuniqueMPgraphic# end=#\\stopuniqueMPgraphic# keepend > contains=@metafunTop > syn region metafunBlock matchgroup=metafunDelim start=#\ > \startMPrun# end=#\\stopMPrun# keepend contains=@metafunTop > > " comments have to be added, \startJScode{name}, "name" has to be > catched and > " typeset in ConTeXt, not in javascript > syn region javascriptBlock matchgroup=javascriptDelim start=#\ > \startJScode# end=#\\stopJScode# keepend contains=@javascriptTop > syn region javascriptBlock matchgroup=javascriptDelim start=#\ > \startJSpreamble# end=#\\stopJSpreamble# keepend > contains=@javascriptTop > > > hi link metafunDelim texSTatement > hi link javascriptDelim texSTatement > > let b:current_syntax = "context" > > " vim: set ts=4 sw=4: > _______________________________________________ > ntg-context mailing list > ntg-context@ntg.nl > http://www.ntg.nl/mailman/listinfo/ntg-context >