summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/third/vim/t-vim.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/third/vim/t-vim.tex')
-rw-r--r--Master/texmf-dist/tex/context/third/vim/t-vim.tex73
1 files changed, 25 insertions, 48 deletions
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 e545a2089f7..81bad980536 100644
--- a/Master/texmf-dist/tex/context/third/vim/t-vim.tex
+++ b/Master/texmf-dist/tex/context/third/vim/t-vim.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=t-vim,
-%D version=2011.01.29,
+%D version=2011.02.05,
%D title=\CONTEXT\ User Module,
%D subtitle=Vim syntax highlighting,
%D author=Aditya Mahajan,
@@ -24,34 +24,19 @@
\setinterfaceconstant {syntax} {syntax}
\stopinterface
-\def\??vimtyping??{vimtyping}
+\def\????vimtyping{@@@@vimtyping}
-\def\vimtypingparameter #1{\csname\docheckparentparameter{\??vimtyping??\currentvimtyping}{#1}\endcsname}
-
-\def\setupvimtyping
- {\dodoubleargument\dosetupvimtyping}
-
-\def\dosetupvimtyping[#1][#2]%
- {\ifsecondargument
- \getparameters[\??vimtyping??#1][#2]%
- \else
- \getparameters[\??vimtyping??][#1]%
- \fi}
-
-\def\dotypevimfile[#1][#2][#3]% id options file
- {\bgroup
- \setupvimtyping[#1][#2]%
- \getvalue{process#1file}[#3]%
- \egroup}
+\installparameterhandler \????vimtyping {vimtyping}
+\installsetuphandler \????vimtyping {vimtyping}
\def\definevimtyping
{\dodoubleargument\dodefinevimtyping}
\def\dodefinevimtyping[#1][#2]%
- {\getparameters[\??vimtyping??#1][\s!parent=\??vimtyping??,#2]%
+ {\getparameters[\????vimtyping#1][\s!parent=\????vimtyping,#2]%
\edef\currentvimtyping{#1}%
- \defineexternalfilter[#1][\s!parent=\??vimtyping??#1]%
- \setvalue{type#1file}{\dotripleargument\dotypevimfile[#1]}
+ \defineexternalfilter[#1][\s!parent=\????vimtyping#1]%
+ \setvalue{type#1file}{\dodoubleargument\doprocessexternalfilterfile[#1]}%
}
\startsetups[vimsetup]
@@ -63,32 +48,25 @@
{\dorecurse{\vimtypingparameter\c!tab}
{\space}}
\doifinset{\vimtypingparameter\c!option}{\v!packed}
- {\setupwhitespace[none]}
- \setcatcodetable\vimcatcodes
+ {\setupwhitespace[\v!none,\v!flexible]}
+ \setcatcodetable\externalfilterwritecatcodes
\stopsetups
\def\vimfiltercommand
{vim -u NONE % don't read global config file
-e % run in ex mode
+ -s % silent
-C % set compatible
-n % no swap file
-c "set tabstop=\vimtypingparameter\c!tab" %
-c "syntax on" %
-c "set syntax=\vimtypingparameter\c!syntax" %
- -c "let contextstartline=\vimtypingparameter\c!start" %
- -c "let contextstopline=\vimtypingparameter\c!stop" %
- -c "source kpse:2context.vim"
- -c "wqa"}
-
-\newcatcodetable \vimcatcodes
-\startcatcodetable \vimcatcodes
- \catcode`\\ = \escapecatcode
- \catcode`\{ = \begingroupcatcode
- \catcode`\} = \endgroupcatcode
- \catcode`\^^M = \activecatcode
- \catcode`\^^L = \activecatcode
- \catcode`\ = \activecatcode
-\stopcatcodetable
+ -c "let contextstartline=\externalfilterparameter\c!start" %
+ -c "let contextstopline=\externalfilterparameter\c!stop" %
+ -c "source 2context.vim" %
+ -c "qa" %
+ \externalfilteroutputfile\space
+ \externalfilterinputfile}
\def\startvimalternative
{\dosingleargument\dostartvimalternative}
@@ -106,19 +84,19 @@
\def\dosetvimsyntax[#1][#2][#3][#4]% name color style command
{\def\dodosetupvimsyntax##1%
{ \doifsomething{#2}
- {\definecolor[\??vimtyping??:\currentvimalternative:##1:color] [#2]%
- \getparameters[\??vimtyping??::\currentvimalternative::##1]
- [\c!color={\??vimtyping??:\currentvimalternative:##1:color}]}
- \getparameters[\??vimtyping??::\currentvimalternative::##1]
+ {\definecolor[\????vimtyping:\currentvimalternative:##1:color] [#2]%
+ \getparameters[\????vimtyping::\currentvimalternative::##1]
+ [\c!color={\????vimtyping:\currentvimalternative:##1:color}]}
+ \getparameters[\????vimtyping::\currentvimalternative::##1]
[\c!style=#3,
\c!command=#4]}%
\processcommalist[#1]\dodosetupvimsyntax}
\def\vimsyntax[#1]#2% style content
- {\dostartattributes{\??vimtyping??::\currentvimalternative::Normal}\c!style\c!color\empty%
- \dostartattributes{\??vimtyping??::\currentvimalternative::#1}\c!style\c!color\empty%
- \getvalue{\??vimtyping??::\currentvimalternative::#1\c!command}{#2}%
+ {\dostartattributes{\????vimtyping::\currentvimalternative::Normal}\c!style\c!color\empty%
+ \dostartattributes{\????vimtyping::\currentvimalternative::#1}\c!style\c!color\empty%
+ \getvalue{\????vimtyping::\currentvimalternative::#1\c!command}{#2}%
\dostopattributes
\dostopattributes}
@@ -192,7 +170,7 @@
\setvimsyntax
[Comment, SpecialComment]
- [][][\slanted]
+ [][][\italic]
\setvimsyntax
[Debug,Ignore]
@@ -211,8 +189,7 @@
\c!alternative=pscolor,
\c!before=,
\c!after=,
- \c!filter=\vimfiltercommand,
- \c!filtercommand={\externalfilterparameter\c!filter\space \externalfilterinputfile},
+ \c!filtercommand=\vimfiltercommand,
\c!continue=yes,
\c!read=\v!yes,
\c!readcommand=\ReadFile,