Fernando Henrique Ferraz Pereira da Rosa
2003-Mar-10 01:51 UTC
[R] VIM Syntax Highlighting
Has anyone got vim to have syntax highlighting with R function codes? I know there's something similar that works with emacs (ESS or something like that), but I was wondering if anyone knew an equivalent that worked with vim. Thank you, -- []'s mentus at gmx.de Bitte l?cheln! Fotogalerie online mit GMX ohne eigene Homepage!
Hi, Fernando> -----Message d'origine----- > De : r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch]De la part de Fernando Henrique > Ferraz Pereira da Rosa > Envoy? : lundi 10 mars 2003 01:52 > ? : r-help at stat.math.ethz.ch > Objet : [R] VIM Syntax Highlighting > > > Has anyone got vim to have syntax highlighting with R > function codes? I > know there's something similar that works with emacs (ESS or > something like > that), but I was wondering if anyone knew an equivalent that > worked with vim.I use the MS-WINDOWS port of vim version 6, which has a syntax file for R by Tom Payne (see http://linux.clare.cam.ac.uk/~twp20/vim/syntax/r.vim). You can also use both TeX and R syntax in Sweave files. Below is what I use in my 'noweb.vim' file: syntax clear runtime! syntax/tex.vim syntax include @nowebR syntax/r.vim syntax region nowebChunk start="^<<.*>>=" end="^@ " contains=@nowebR syntax region Sexpr start="\\Sexpr{" end="}" keepend hi Sexpr gui=bold guifg=chocolate2 Hope it helps. Christophe -- Christophe DECLERCQ, MD Observatoire R?gional de la Sant? Nord-Pas-de-Calais 13, rue Faidherbe 59046 LILLE Cedex FRANCE Phone +33 3 20 15 49 24 Fax +33 3 20 55 92 30 E-mail c.declercq at orsnpdc.org
In the Windows (GVIM - version 6.1) as well as the Linux version (GVIM - 6.1) that syntax highlighting capability is already built in VIM. Go to Syntax and then click on the first line of the menu (Show individual choices). That menu will change, now instead of "Show individual choices" you will ge a list of words sorted in alphabetical order, go to "R-Sg" and the first choice will be "R". That is what you need. Regards, Carlos. -----Mensaje original----- De: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch]En nombre de Fernando Henrique Ferraz Pereira da Rosa Enviado el: lunes, 10 de marzo de 2003 2:52 Para: r-help at stat.math.ethz.ch Asunto: [R] VIM Syntax Highlighting Has anyone got vim to have syntax highlighting with R function codes? I know there's something similar that works with emacs (ESS or something like that), but I was wondering if anyone knew an equivalent that worked with vim. Thank you, -- []'s mentus at gmx.de Bitte l?cheln! Fotogalerie online mit GMX ohne eigene Homepage! ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help ### This email has been checked for all known viruses by the ### Firstnet anti-virus system - http://www.firstnet.net.uk ### Please email fav at firstnet.net.uk for details. _____ The information in this email is confidential and it may not be\... [[dropped]]
On Mon, 10 Mar 2003, Fernando Henrique Ferraz Pereira da Rosa wrote:> Has anyone got vim to have syntax highlighting with R function codes? I > know there's something similar that works with emacs (ESS or something like > that), but I was wondering if anyone knew an equivalent that worked with vim. >Version 5.6.70 of vim comes with a syntax file for "S-lang" as standard. Either pick "S-lang" from the "Syntax" menu or do ":cal SetSyn("slang")" on the vim command line. Not surprisingly, this works perfectly well with either S or R. Luke Whitaker