summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-09-20 18:28:05 +0000
committerKarl Berry <karl@freefriends.org>2008-09-20 18:28:05 +0000
commitc21d970b4019f5feacf1d225aaf5a091ddf64b53 (patch)
tree52accaa74b442e7071c67607f5c534c7f597b050 /Master/texmf-dist/tex/context
parent019c2bee669bb556a2a1dae824548da20646fff9 (diff)
context-vim update (16sep08)
git-svn-id: svn://tug.org/texlive/trunk@10661 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context')
-rw-r--r--Master/texmf-dist/tex/context/third/vim/t-vim.tex81
1 files changed, 51 insertions, 30 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 43de298ba9d..662fa4049d2 100644
--- a/Master/texmf-dist/tex/context/third/vim/t-vim.tex
+++ b/Master/texmf-dist/tex/context/third/vim/t-vim.tex
@@ -2,7 +2,7 @@
%D \module
%D [ file=t-vim,
-%D version=2007.01.03,
+%D version=2008.07.15,
%D title=\VIM\ to \CONTEXT,
%D subtitle=Use \VIM\ to generate code listing,
%D author=Mojca Miklavec \& Aditya Mahajan,
@@ -10,17 +10,19 @@
%D date=\currentdate,
%D copyright=Public Domain]
+%M
%M \usemodule [vim]
%M \usemodule[int-load]
-%M \loadsetups[vim.xml]
+%M \loadsetups[t-vim.xml]
%M \usetypescript[modern-base][texnansi] \setupbodyfont[modern]
%M \setuptyping[option=color]
+%M \setupcolors[state=start]
%D \section {User Manual}
%D
%D \CONTEXT\ has an excellent pretty printing capabilities for many languages.
%D The code for pretty printing is written in \TEX, and due to catcode
-%D jugglary verbatim typesetting is perhaps the trickiest part of \TEX. This
+%D jugglery verbatim typesetting is perhaps the trickiest part of \TEX. This
%D makes it difficult for a \quotation{normal} user to define syntax
%D highlighting rules for a new language. This module, takes the onus of
%D defining syntax highlighting rules away from the user and uses \VIM\ editor
@@ -60,19 +62,21 @@
%D
%D Here \type{syntax} is the syntax file in \VIM\ for the language
%D highlighting that you want. See \type{:he syntax.txt} inside \VIM\ for
-%D details. \type{colorscheme} provides the sytax highlighting for various
+%D details. \type{colorscheme} provides the syntax highlighting for various
%D regions. Right now, two colorschemes are defined. The \type{default}
%D colorscheme is based on on \filename{ps_color.vim} colorscheme in \VIM, and
%D the \type{blackandwhite} colorscheme is based on \filename{print_bw.vim}.
%D If there is a particular colorscheme that you will like, you can convert it
%D into \CONTEXT. \type{space=(yes|on|no)} makes the space significant,
-%D visible, and unsignificant respectively. \type{tab} specifies the number of
+%D visible, and insignificant respectively. \type{tab} specifies the number of
%D spaces a tab is equivalent to. It's default value is 8. \type{start} and
%D \type{stop} specify which lines to read from a file. These options only
%D make sense for highlighting files and should not to be set by
%D \type{\setupvimtyping}. \type{numbering} enables line numbering, and
%D \type{step} specifies which lines are numbered. \type{numberstyle} and
-%D \type{numbercolor} specify the style and color of line numbers.
+%D \type{numbercolor} specify the style and color of line numbers. By
+%D default the numbers are placed on the left. The location of the numbers can
+%D be configured using \type{numbercommand} option.
%D
%D A new typing region can be define using \type{\definevimtyping}.
%D
@@ -128,12 +132,12 @@
%D change something, read ahead.
%D \section {Module Details}
-%D The synax highlighting of the source here is done using \type{t-vim}
+%D The syntax highlighting of the source here is done using \type{t-vim}
%D module. There is a bug in the module due to which line numberings for
-%D different filetypes use the same counter. In the source we use a
-%D round||about method to correct this. Right now, in case someone needs this
-%D module for numbering more than one filetype, let me know, and I will try to
-%D iron out the bug.
+%D different filetypes use the same counter. In the source round||about
+%D method to correct this. Right now, in case someone needs this module for
+%D numbering more than one filetype, let me know, and I will try to iron
+%D out the bug.
%M % Due to the bug in numbering
%M \definevimtyping [definition] [syntax=context,start=1,numbering=on]
@@ -245,6 +249,20 @@
{\dodotypevimfile[#1]{#2}}
{\reporttypingerror{#2}}}
+
+\def\saveandtypevimfile[#1]%
+ {\savevimbuffer
+ \dotypevimfile[#1]{\TEXbufferfile{vimsyntax}}}
+
+
+\let\savevimbuffer\donothing
+
+\beginLUATEX
+
+\def\savevimbuffer{\savebuffer[vimsyntax]}
+
+\endLUATEX
+
\def\dodotypevimfile[#1]#2%
{\@@vsbefore
\bgroup
@@ -275,7 +293,7 @@
\pluscounter{vimlinenumber}}
\def\showvimlinenumber
- {\inmargin%TODO: make configurable
+ {\@@vsnumbercommand
{\dostartattributes\??vs\c!numberstyle\c!numbercolor\empty
\countervalue{vimlinenumber}
\dostopattributes}}
@@ -306,22 +324,24 @@
\def\obeyedline{\placevimlinenumber\par\strut}
}
+\def\shellescapedquote{\letterbackslash\letterdoublequote}
+
\def\runvimsyntax#1
{\executesystemcommand
- {texmfstart bin:vim
+ {mtxrun --verbose --noquote bin:vim
"-u NONE % No need to read unnessary configurations
-e % run in ex mode
-% -V10log % For debugging only, will go away later.
- -c \letterbackslash"set noswapfile\letterbackslash"
- -c \letterbackslash"set tabstop=\@@vstab\letterbackslash"
- -c \letterbackslash"set cp\letterbackslash"
- -c \letterbackslash"syntax on\letterbackslash"
- -c \letterbackslash"set syntax=\@@vssyntax\letterbackslash"
- -c \letterbackslash"let contextstartline=\@@vsstart\letterbackslash"
- -c \letterbackslash"let contextstopline=\@@vsstop\letterbackslash"
- -c \letterbackslash"source kpse:2context.vim\letterbackslash"
- -c \letterbackslash"wqa\letterbackslash"
- " #1}}
+ -C % Set compatibile
+ -n % No swap
+% -V10log % For debugging only, will go away later.
+ -c \shellescapedquote set tabstop=\@@vstab \shellescapedquote\space
+ -c \shellescapedquote syntax on\shellescapedquote\space
+ -c \shellescapedquote set syntax=\@@vssyntax\shellescapedquote\space
+ -c \shellescapedquote let contextstartline=\@@vsstart\shellescapedquote\space
+ -c \shellescapedquote let contextstopline=\@@vsstop\shellescapedquote \space
+ -c \shellescapedquote source kpse:2context.vim\shellescapedquote\space
+ -c \shellescapedquote wqa\shellescapedquote\space
+ \shellescapedquote#1\shellescapedquote\space "}}
%D \macros{definetypevimfile}
@@ -352,18 +372,18 @@
%D \stopbuffer
%D \typebuffer gives \getbuffer
-%M %More bug fixes to get the line numbering in documentaion right.
-%M \definevimtyping [definition] [syntax=context,start=109,numbering=on]
+%M %More bug fixes to get the line numbering in documentation right.
+%M \definevimtyping [definition] [syntax=context,start=119,numbering=on]
\def\definevimtyping
{\dodoubleargument\dodefinevimtyping}
-%M %More bug fixes to get the line numbering in documentaion right.
+%M %More bug fixes to get the line numbering in documentation right.
%M \definevimtyping [definition] [syntax=context,start=continue,numbering=on]
\def\dodefinevimtyping[#1][#2]%
{\setevalue{\e!start#1}{\noexpand\dostartbuffer[vimsyntax][\e!start#1][\e!stop#1]}%
- \setvalue{\e!stop#1}{\dodotypevimfile[#2]{\TEXbufferfile{vimsyntax}}}}
+ \setvalue{\e!stop#1}{\saveandtypevimfile[#2]}}
%D Some defaults.
@@ -376,13 +396,14 @@
\c!before=,
\c!after=,
\c!numbering=\v!off,
+ \c!numbercommand=\inleft,
\c!numberstyle=\v!smallslanted,
\c!numbercolor=,
\c!step=1,
colorscheme=default,
]
-%D Pre-defined Syntax : {{{
+%D Pre-defined Syntax : % {{{
%D This is based on \filename{ps_color.vim}, which does not use any bold
%D typeface.
@@ -582,7 +603,7 @@
\stopmodule
-%D An example usage: {{{
+%D An example usage: % {{{
\doifnotmode{demo}{\endinput}