summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/context/third/vim/vim.txt41
-rw-r--r--Master/texmf-dist/tex/context/third/vim/2context.vim5
-rw-r--r--Master/texmf-dist/tex/context/third/vim/t-syntax-groups.tex47
-rw-r--r--Master/texmf-dist/tex/context/third/vim/t-syntax-highlight.tex4
-rw-r--r--Master/texmf-dist/tex/context/third/vim/t-vim.tex40
5 files changed, 121 insertions, 16 deletions
diff --git a/Master/texmf-dist/doc/context/third/vim/vim.txt b/Master/texmf-dist/doc/context/third/vim/vim.txt
index ed6c0e3feae..a7fc9128f10 100644
--- a/Master/texmf-dist/doc/context/third/vim/vim.txt
+++ b/Master/texmf-dist/doc/context/third/vim/vim.txt
@@ -390,6 +390,47 @@ highlighted line will be numbered thrice (with the numbers overprinted on one
another). This is because, internally, highlighting is implemented using text
backgrounds and they do not work with line numbering.
+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
+file and then use it.
+
+To create a vimrc file, use
+
+ \startvimrc[name=...]
+ ...
+ \stopvimrc
+
+The `name=...` is necessary. To enable the settings in this vimrc file, use:
+
+ \definevimtyping
+ [...]
+ [...
+ vimrc=...,
+ ...]
+
+The value of `vimrc` key needs to be the same as the value of the `name`
+key in `\startvimrc`. You may set the `vimrc` file for a particular code snippet
+by
+
+ \start<vimtyping>[vimrc=....]
+ ...
+ \stop<vimtyping>
+
+
+To disable loading of vimrc file, use
+
+ \definevimtyping
+ [...]
+ [...
+ vimrc=none,
+ ...]
+
+
+The default is not to use any vimrc file.
+
Messages and Tracing
--------------------
diff --git a/Master/texmf-dist/tex/context/third/vim/2context.vim b/Master/texmf-dist/tex/context/third/vim/2context.vim
index ad41dc5c375..17a63b1fcfa 100644
--- a/Master/texmf-dist/tex/context/third/vim/2context.vim
+++ b/Master/texmf-dist/tex/context/third/vim/2context.vim
@@ -33,6 +33,11 @@ else
let s:lstop = line("$")
endif
+" Set highlight
+if !exists("highlight")
+ let highlight=[]
+endif
+
let s:strip = strlen( matchstr( getline(s:lstart), '^\s*' ) )
" Find the smallest leading white space
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 b9630e6c8fc..3ecf5f319e1 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=2011.08.28,
+%D version=2011.09.03,
%D title=\CONTEXT\ User Module,
%D subtitle=Syntax highlighting support,
%D author=Aditya Mahajan,
@@ -9,7 +9,9 @@
%D email=adityam <at> ieee <dot> org,
%D license=Simplified BSD License]
-\writestatus{loading}{ConTeXt User Module / Syntax Highlighting Support ver: 2011.08.28}
+\writestatus{loading}{Syntax highlighting groups (ver: 2011.09.03)}
+
+\tracingmacros=1
% Colors are specified in hex; in MkII the hex mode needs to be activated.
\doifmode\s!mkii
@@ -23,12 +25,14 @@
\def\colorscheme::name {}
\def\syntaxgroup::id {syntaxgroup}
-\def\syntaxgroup::namespace {@@@@\colorscheme::name\syntaxgroup::id}
+\def\syntaxgroup::namespace {@@@@\syntaxgroup::id}
\def\syntaxgroup::name {}
\installparameterhandler \syntaxgroup::namespace \syntaxgroup::id
\installsetuphandler \syntaxgroup::namespace \syntaxgroup::id
+\def\m!syntaxgroup{t-syntax-group}
+
\def\definesyntaxgroup
{\dodoubleargument\syntaxgroup::define}
@@ -39,24 +43,31 @@
{
\def\syntaxgroup::get_parameters##1%
{
- \edef\syntaxgroup::name {##1}
- \setupsyntaxgroup[##1]
+ \edef\syntaxgroup::name {\colorscheme::name##1}
+ \setupsyntaxgroup[\syntaxgroup::name]
[\c!color=,\c!style=,\c!command=,#2]
\doifsomething{\syntaxgroupparameter\c!color}
{
\expanded{\definecolor[\syntaxgroup::namespace-##1-color]
[\syntaxgroupparameter\c!color]}
- \setupsyntaxgroup[##1][\c!color=\syntaxgroup::namespace-##1-color]
+ \setupsyntaxgroup[\syntaxgroup::name][\c!color=\syntaxgroup::namespace-##1-color]
}
}
}{
\def\syntaxgroup::get_parameters##1%
{
- \copyparameters[\syntaxgroup::namespace##1][\syntaxgroup::namespace#2]
- [\c!color,\c!style,\c!command]
+ \edef\syntaxgroup::name {\colorscheme::name##1}
+ \expanded{\setupsyntaxgroup[\syntaxgroup::name]
+ [\c!color=\namedsyntaxgroupparameter{\colorscheme::name#2}\c!color,
+ \c!style=\namedsyntaxgroupparameter{\colorscheme::name#2}\c!style,
+ \c!command=\namedsyntaxgroupparameter{\colorscheme::name#2}\c!command,
+ ]}
+
+ % In MkII, \expanded messes up the definition of \currentsyntaxgroup
+ \def\currentsyntaxgroup {\syntaxgroup::name}
}
}
-
+
\processcommalist[#1]\syntaxgroup::get_parameters
\stoptexdefinition
@@ -79,7 +90,10 @@
% #1 = style
% #2 = content
\begingroup
- \edef\syntaxgroup::name{#1}%
+ \edef\syntaxgroup::name{\colorscheme::name#1}%
+ \iftracesyntaxgroups
+ \syntaxgroup::show_values
+ \fi
\syntaxgroupparameter\c!command
{
\externalfilter::attributes_start\syntaxgroup::id\c!style\c!color
@@ -89,7 +103,20 @@
\endgroup
\stoptexdefinition
+%D Tracing macros
+
+\newif\iftracesyntaxgroups
+\let\tracesyntaxgroups\tracesyntaxgroupstrue
+
\def\currentsyntaxgroup {\syntaxgroup::name}
+\starttexdefinition syntaxgroup::show_values
+ \writestatus\m!syntaxgroup{color scheme : \colorscheme::name}
+ \writestatus\m!syntaxgroup{current group: \syntaxgroup::name}
+ \writestatus\m!syntaxgroup{command : \syntaxgroupparameter\c!command}
+ \writestatus\m!syntaxgroup{style : \syntaxgroupparameter\c!style}
+ \writestatus\m!syntaxgroup{color : \syntaxgroupparameter\c!color}
+\stoptexdefinition
+
\protectmodulecatcodes
\stopmodule
diff --git a/Master/texmf-dist/tex/context/third/vim/t-syntax-highlight.tex b/Master/texmf-dist/tex/context/third/vim/t-syntax-highlight.tex
index 8c0cf3d3f1d..dca073244e8 100644
--- a/Master/texmf-dist/tex/context/third/vim/t-syntax-highlight.tex
+++ b/Master/texmf-dist/tex/context/third/vim/t-syntax-highlight.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=t-syntax-highlight,
-%D version=2011.08.28,
+%D version=2011.09.03,
%D title=\CONTEXT\ User Module,
%D subtitle=Code syntax highlighting,
%D author=Aditya Mahajan,
@@ -9,7 +9,7 @@
%D email=adityam <at> ieee <dot> org,
%D license=Simplified BSD License]
-\writestatus{loading}{ConTeXt User Module / Code syntax highlighting ver: 2011.08.28}
+\writestatus{loading}{Code syntax highlighting (ver: 2011.09.03)}
\startmodule [syntax-highlight]
\usemodule [syntax-groups]
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 89f56bc8409..76dfab6b88a 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.08.27,
+%D version=2011.09.03,
%D title=\CONTEXT\ User Module,
%D subtitle=Vim syntax highlighting,
%D author=Aditya Mahajan,
@@ -9,7 +9,7 @@
%D email=adityam <at> ieee <dot> org,
%D license=Simplified BSD License]
-\writestatus{loading}{ConTeXt User Module / Vim syntax highlighting ver: 2011.08.27}
+\writestatus{loading}{Vim syntax highlighting (ver: 2011.09.03)}
\startmodule [vim]
\usemodule [filter]
@@ -17,12 +17,18 @@
\usemodule [syntax-groups]
\usemodule [module-catcodes]
+\startinterface all
+ \setinterfaceconstant {vimrc} {vimrc}
+\stopinterface
+
\unprotectmodulecatcodes
\def\vimtyping::id {vimtyping}
\def\vimtyping::namespace {@@@@\vimtyping::id}
\def\vimtyping::name {}
+\def\vimrc::id {vimrc}
+
\installparameterhandler \vimtyping::namespace \vimtyping::id
\installsetuphandler \vimtyping::namespace \vimtyping::id
@@ -43,7 +49,8 @@
{\def\vimtyping::script_name{kpse:2context.vim}}
\def\vimtyping::filter_command
- {vim -u NONE % don't read global config file
+ {vim -u \vimrcfilename\space % read global config file
+ --noplugin % dont load plugins
-e % run in ex mode
-s % silent
-C % set compatible
@@ -85,9 +92,11 @@
% \c!read=\v!yes,
% \c!readcommand=\syntaxhighlighting::read_command,
\c!output=\externalfilterbasefile.vimout,
- % \c!setups=syntaxhighlighting::setup,
+ %\c!setups=syntaxhighlighting::setup,
+ \c!filter\c!setups=vimrc::setup,
% \c!option=\v!packed, % Could be a list
\s!parent=\syntaxhighlighting::namespace,
+ \c!vimrc=,
% % Numbering options
% \c!numbering=\v!no,
% \c!number\c!start=1,
@@ -108,6 +117,29 @@
\def\currentvimtyping {\vimtyping::name}
+\defineexternalfilter
+ [\vimrc::id]
+ [\c!continue=\v!no,
+ \c!read=\v!no,
+ \c!filtercommand=\empty]
+
+\def\vimrcfilename{NONE}
+
+\startsetups vimrc::setup
+ \doifelsenothing{\externalfilterparameter\c!vimrc}
+ {\def\vimrcfilename{NONE}}
+ {\begingroup
+ \expanded{\setupexternalfilter[\vimrc::id][\c!name=\externalfilterparameter\c!vimrc]}
+
+ \edef\externalfilter::name{\vimrc::id}
+ \externalfilter::set_filenames
+
+ \global\xdef\vimrcfilename{\externalfilter::input_file}
+ \endgroup
+ }
+\stopsetups
+
+
\startsetups[vim-minor-groups]
\definesyntaxgroup
[SpecialComment]