diff options
author | Karl Berry <karl@freefriends.org> | 2011-09-05 00:15:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-09-05 00:15:47 +0000 |
commit | b16b1651b5d296cd70188fe4ff2f1a72f81c4993 (patch) | |
tree | f8f85c66986096ed0976aba98e6a203ae363a997 /Master/texmf-dist/tex | |
parent | c3ed9e84dc5c1916d9e69d90d6665211aaf120c8 (diff) |
context-vim (4sep11)
git-svn-id: svn://tug.org/texlive/trunk@23813 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
4 files changed, 80 insertions, 16 deletions
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] |