From 050038704b1e3d4885ff94896915f3139cb9ba9f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 7 May 2012 22:51:50 +0000 Subject: context-vim (7may12) git-svn-id: svn://tug.org/texlive/trunk@26249 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/context/third/vim/vim.txt | 24 ++++++------ .../tex/context/third/vim/t-syntax-groups.tex | 12 +++--- .../tex/context/third/vim/t-syntax-highlight.mkii | 7 +--- .../tex/context/third/vim/t-syntax-highlight.mkiv | 44 ++++++++++++---------- Master/texmf-dist/tex/context/third/vim/t-vim.tex | 2 + 5 files changed, 47 insertions(+), 42 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/context/third/vim/vim.txt b/Master/texmf-dist/doc/context/third/vim/vim.txt index 272e509d435..43b02b3942f 100644 --- a/Master/texmf-dist/doc/context/third/vim/vim.txt +++ b/Master/texmf-dist/doc/context/third/vim/vim.txt @@ -165,7 +165,7 @@ Running an external file through vim is slow. So, `t-vim` reprocesses a snippet or a file only if its contents have changed. To check if the contents have changed, it writes each snippet to a different file and stores the md5 sum of that snippet. As a result, the working directory gets cluttered with lot of -temporary files. To avoid this clutter, write the temporary files to an a +temporary files. To avoid this clutter, write the temporary files to a different directory using the `directory` key. For example, \definevimtyping[...] @@ -320,7 +320,7 @@ indent the TeX code. For example: Although, the source code is easy to read, the output will not be. This is because, unlike regular TeX, `\start` ... `\stop` -environment does not ignore whote space. So, the output is the same as +environment does not ignore white space. So, the output is the same as \startitemize \item A hello world example in C @@ -423,7 +423,7 @@ enable this use When `escape=on`, the `2context.vim` script passes the `Comment` syntax region (as identified by `vim`) verbatim to TeX. So, we may use TeX -commands inside the comment region and they will be interpretted by TeX. +commands inside the comment region and they will be interpreted by TeX. For example \definevimtyping[C][syntax=c, escape=on] @@ -444,16 +444,16 @@ Tuning color schemes -------------------- Some vim syntax files have optional features that are turned on or off using -variables. To enable these optional features, you need to first create a vimrc +variables. To enable these optional features, you need to first create a `vimrc` file and then use it. -To create a vimrc file, use +To create a `vimrc` file, use \startvimrc[name=...] ... \stopvimrc -The `name=...` is necessary. To enable the settings in this vimrc file, use: +The `name=...` is necessary. To enable the settings in this `vimrc` file, use: \definevimtyping [...] @@ -466,11 +466,11 @@ key in `\startvimrc`. You may set the `vimrc` file for a particular code snippet by \start[vimrc=....] - ... + .. \stop -To disable loading of vimrc file, use +To disable loading of `vimrc` file, use \definevimtyping [...] @@ -479,11 +479,11 @@ To disable loading of vimrc file, use ...] -The default is not to use any vimrc file. +The default is not to use any `vimrc` file. -A vimrc file gets loaded before syntax highlighting is enabled. If you want to +A `vimrc` file gets loaded before syntax highlighting is enabled. If you want to override the default syntax highlighting scheme, add the appropriate `syn ...` -commands to a vimrc file, and source that usign +commands to a `vimrc` file, and source that using \definevimtyping [...] @@ -528,7 +528,7 @@ is displayed in the console. At the same time, the string [[output file missing]] is displayed in the PDF output. This data, along with the filter command, is -useful for debugging what whenwrong. +useful for debugging what whet wrong. Yes, on, whatever ----------------- diff --git a/Master/texmf-dist/tex/context/third/vim/t-syntax-groups.tex b/Master/texmf-dist/tex/context/third/vim/t-syntax-groups.tex index fa608595543..db526bf77e9 100644 --- a/Master/texmf-dist/tex/context/third/vim/t-syntax-groups.tex +++ b/Master/texmf-dist/tex/context/third/vim/t-syntax-groups.tex @@ -1,6 +1,6 @@ %D \module %D [ file=t-syntax-groups, -%D version=2012.01.03, +%D version=2012.05.06, %D title=\CONTEXT\ User Module, %D subtitle=Syntax highlighting support, %D author=Aditya Mahajan, @@ -9,7 +9,7 @@ %D email=adityam ieee org, %D license=Simplified BSD License] -\writestatus{loading}{Syntax highlighting groups (ver: 2012.01.03)} +\writestatus{loading}{Syntax highlighting groups (ver: 2012.05.06)} \startmodule [syntax-group] \usemodule [module-catcodes] @@ -49,12 +49,12 @@ { \edef\syntaxgroup@name {\colorscheme@name##1} \setupsyntaxgroup[\syntaxgroup@name] - [\c!color=,\c!style=,\c!command=,#2] + [\s!parent=\syntaxgroup@namespace,\c!color=,\c!style=,\c!command=,#2] \doifsomething{\syntaxgroupparameter\c!color} { \expanded{\definecolor[\syntaxgroup@namespace-##1-color] [\syntaxgroupparameter\c!color]} - \setupsyntaxgroup[\syntaxgroup@name][\c!color=\syntaxgroup@namespace-##1-color] + \setupsyntaxgroup[\syntaxgroup@name][\s!parent=\syntaxgroup@namespace,\c!color=\syntaxgroup@namespace-##1-color] } } }{ @@ -93,9 +93,9 @@ \starttexdefinition syntaxgroup [#1]#2 % #1 = style % #2 = content - \syntaxgroupparameter\c!before \begingroup \edef\syntaxgroup@name{\colorscheme@name#1}% + \syntaxgroupparameter\c!before \iftracesyntaxgroups \syntaxgroup@show_values \fi @@ -107,8 +107,8 @@ \externalfilter@attributes_stop } \doifmode{\s!mkiv}{\dostoptagged} - \endgroup \syntaxgroupparameter\c!after + \endgroup \stoptexdefinition %D Tracing macros diff --git a/Master/texmf-dist/tex/context/third/vim/t-syntax-highlight.mkii b/Master/texmf-dist/tex/context/third/vim/t-syntax-highlight.mkii index 7f4006ef7c1..375dc5381b2 100644 --- a/Master/texmf-dist/tex/context/third/vim/t-syntax-highlight.mkii +++ b/Master/texmf-dist/tex/context/third/vim/t-syntax-highlight.mkii @@ -72,13 +72,9 @@ \doifinset{\externalfilterparameter\c!option}{\v!packed} {\setupwhitespace[\v!none,\v!flexible]}% - \doifnotinset{\externalfilterparameter\c!option}{\v!hyphenated} - {\language\minusone}% - \setcatcodetable\externalfilter@minimal_catcodes \expandafter\def\activeendoflinetoken{\strut\par} \activatespacehandler{\syntaxhighlighting@namespace\externalfilterparameter\c!space} - \raggedright \stopsetups \startsetups syntaxhighlighting@setup_line_number_mkiv @@ -182,13 +178,14 @@ \c!location=\v!paragraph, \c!style=\tttf, \c!color=, + \c!align={\v!flushleft,\v!nothyphenated}, \c!filtercommand=echo, % placeholder \c!continue=yes, \c!read=\v!yes, \c!readcommand=\syntaxhighlighting@read_command, \c!output=\externalfilterinputfile, % placeholder \c!setups=syntaxhighlighting@setup, - \c!option=\v!packed, % \v!hypenated + \c!option=\v!packed, % Can be a list, \s!parent=\externalfilter@namespace, % Numbering options \c!numbering=\v!no, diff --git a/Master/texmf-dist/tex/context/third/vim/t-syntax-highlight.mkiv b/Master/texmf-dist/tex/context/third/vim/t-syntax-highlight.mkiv index 3420f8c0118..6140ca36e23 100644 --- a/Master/texmf-dist/tex/context/third/vim/t-syntax-highlight.mkiv +++ b/Master/texmf-dist/tex/context/third/vim/t-syntax-highlight.mkiv @@ -1,6 +1,6 @@ %D \module %D [ file=t-syntax-highlight, -%D version=2012.05.01, +%D version=2012.05.06, %D title=\CONTEXT\ User Module, %D subtitle=Code syntax highlighting, %D author=Aditya Mahajan, @@ -9,7 +9,7 @@ %D email=adityam ieee org, %D license=Simplified BSD License] -\writestatus{loading}{Code syntax highlighting (ver: 2012.05.01)} +\writestatus{loading}{Code syntax highlighting (ver: 2012.05.06)} \startmodule [syntax-highlight] \usemodule [syntax-groups] @@ -37,10 +37,29 @@ \appendtoks \defineexternalfilter[\currentsyntaxhighlighting] [\s!parent=\????syntaxhighlighting\currentexternalfilter,\c!taglabel=\vimtyping@id]% - \definelinenumbering [\currentsyntaxhighlighting]% \setevalue{type\currentsyntaxhighlighting file}{\getvalue{process\currentsyntaxhighlighting file}}% + \definelinenumbering [\currentsyntaxhighlighting]% \to\everydefinesyntaxhighlighting +\appendtoks + % \externalfitlterparameter does not work, so it is better to use + % \syntaxhighlighting parameter. + \normalexpanded{\setuplinenumbering[\currentsyntaxhighlighting] + [ + \c!method=\syntaxhighlightingparameter{\c!number\c!method}, + \c!conversion=\syntaxhighlightingparameter\c!numberconversion, + \c!location=\syntaxhighlightingparameter{\c!number\c!location}, + \c!style=\syntaxhighlightingparameter\c!numberstyle, + \c!color=\syntaxhighlightingparameter\c!numbercolor, + \c!width=\syntaxhighlightingparameter{\c!number\c!width}, + \c!left=\syntaxhighlightingparameter{\c!number\c!left}, + \c!right=\syntaxhighlightingparameter{\c!number\c!right}, + \c!command=\syntaxhighlightingparameter\c!numbercommand, + \c!distance=\syntaxhighlightingparameter{\c!number\c!distance}, + \c!align=\syntaxhighlightingparameter{\c!number\c!align}, + ]}% +\to\everysetupsyntaxhighlighting + \def\syntaxhighlighting@id {syntaxhighlighting} \edef\t!syntaxhighlighting {\syntaxhighlighting@id} @@ -67,13 +86,9 @@ \doifinset{\externalfilterparameter\c!option}{\v!packed} {\setupwhitespace[\v!none,\v!flexible]}% - \doifnotinset{\externalfilterparameter\c!option}{\v!hyphenated} - {\language\minusone}% - \setcatcodetable\externalfilter@minimal_catcodes \expandafter\def\activeendoflinetoken{\strut\par} \activatespacehandler{\????syntaxhighlighting\externalfilterparameter\c!space} - \raggedright \stopsetups \starttexdefinition syntaxhighlighting@read_command #1 @@ -86,19 +101,9 @@ \doifinset{\externalfilterparameter\c!numbering}\syntaxhighlighting@yes {\startlinenumbering [\currentsyntaxhighlighting] - [\c!conversion=\externalfilterparameter\c!numberconversion, + [ \c!start=\externalfilterparameter{\c!number\c!start}, \c!step=\externalfilterparameter{\c!number\c!step}, - \c!method=\externalfilterparameter{\c!number\c!method}, - \c!location=\externalfilterparameter{\c!number\c!location}, - \c!style=\externalfilterparameter\c!numberstyle, - \c!color=\externalfilterparameter\c!numbercolor, - \c!width=\externalfilterparameter{\c!number\c!width}, - \c!left=\externalfilterparameter{\c!number\c!left}, - \c!right=\externalfilterparameter{\c!number\c!right}, - \c!command=\externalfilterparameter\c!numbercommand, - \c!distance=\externalfilterparameter{\c!number\c!distance}, - \c!align=\externalfilterparameter{\c!number\c!align}, \c!continue=\externalfilterparameter{\c!number\c!continue}, ]} \dostarttagged\t!syntaxhighlighting\colorscheme@name @@ -126,13 +131,14 @@ \c!location=\v!paragraph, \c!style=\tttf, \c!color=, + \c!align={\v!flushleft,\v!nothyphenated}, \c!filtercommand=echo, % placeholder \c!continue=yes, \c!read=\v!yes, \c!readcommand=\syntaxhighlighting@read_command, \c!output=\externalfilterinputfile, % placeholder \c!setups=syntaxhighlighting@setup, - \c!option=\v!packed, % \v!hypenated + \c!option=\v!packed, % Can be a list, \s!parent=\????externalfilter, % Numbering options \c!numbering=\v!no, diff --git a/Master/texmf-dist/tex/context/third/vim/t-vim.tex b/Master/texmf-dist/tex/context/third/vim/t-vim.tex index d95b694a8aa..daa3da08202 100644 --- a/Master/texmf-dist/tex/context/third/vim/t-vim.tex +++ b/Master/texmf-dist/tex/context/third/vim/t-vim.tex @@ -37,6 +37,8 @@ \setupvimtyping[#1][\s!parent=\vimtyping@namespace,#2] \definesyntaxhighlighting[#1][\s!parent=\vimtyping@namespace#1] + \setupsyntaxhighlighting [#1][#2] + \setvalue{\e!start raw#1}{\bgroup\obeylines\dodoubleargument\vimtyping@start_raw[#1]} \setvalue{\e!stop raw#1}{\vimtyping@stop_raw} -- cgit v1.2.3