summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/context
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-01-31 16:55:42 +0000
committerKarl Berry <karl@freefriends.org>2011-01-31 16:55:42 +0000
commit8be4b350536828e1d6bc445cadf69e0fa5200814 (patch)
treeada4e1e54edd26dd9d5a64ff025f98311d695785 /Master/texmf-dist/doc/context
parent5009205ff9d52ef6018eda1bbb849de03b7ad621 (diff)
context-vim (30jan11)
git-svn-id: svn://tug.org/texlive/trunk@21240 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/context')
-rw-r--r--Master/texmf-dist/doc/context/third/vim/README15
-rw-r--r--Master/texmf-dist/doc/context/third/vim/vim-demo.pdfbin120029 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/vim/vim-doc.pdfbin289748 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/context/third/vim/vim.txt60
4 files changed, 60 insertions, 15 deletions
diff --git a/Master/texmf-dist/doc/context/third/vim/README b/Master/texmf-dist/doc/context/third/vim/README
deleted file mode 100644
index e98b964acf8..00000000000
--- a/Master/texmf-dist/doc/context/third/vim/README
+++ /dev/null
@@ -1,15 +0,0 @@
-Name of module: ViM syntax highlighting
-Author: Aditya Mahajan and Mojca Miklavec
-
-Description: ConTeXt has an excellent pretty printing capabilities for many
-languages. The code for pretty printing is written in TeX, and due to catcode
-jugglary verbatim typesetting is perhaps the trickiest part of TeX. This makes
-it difficult for a "normal" user to define syntax highlighting rules for a new
-language. This module, takes the onus of defining syntax highlighting rules
-away from the user and uses ViM editor to generate the syntax highlighting.
-There is a helper 2context.vim script to do the syntax parsing in ViM. This is
-a stop-gap method, and hopefully with luaTeX, things will be much easier.
-
-The module documentation is available in doc/context/third/vim/vim-doc.pdf and
-a demo is at doc/context/third/vim/vim-demo.pdf
-
diff --git a/Master/texmf-dist/doc/context/third/vim/vim-demo.pdf b/Master/texmf-dist/doc/context/third/vim/vim-demo.pdf
deleted file mode 100644
index efd3911e4d0..00000000000
--- a/Master/texmf-dist/doc/context/third/vim/vim-demo.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/vim/vim-doc.pdf b/Master/texmf-dist/doc/context/third/vim/vim-doc.pdf
deleted file mode 100644
index ef82a58fd08..00000000000
--- a/Master/texmf-dist/doc/context/third/vim/vim-doc.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/context/third/vim/vim.txt b/Master/texmf-dist/doc/context/third/vim/vim.txt
new file mode 100644
index 00000000000..251565547fc
--- /dev/null
+++ b/Master/texmf-dist/doc/context/third/vim/vim.txt
@@ -0,0 +1,60 @@
+The vim module
+==============
+
+ConTeXt has excellent code highlighting capabilities for some languages: TeX,
+metapost, XML, amongst others. In MkII, syntax highlighting was done by parsing
+the source code in TeX---a task not for the faint of heart. In MkIV, the
+situation is much better: syntax highlighting is done by parsing the source code
+in Lua using LPEG. Nonetheless, writing a grammar to parse the source code of
+languages is a tricky task. This module takes the onus of defining such a
+grammar away from the user and uses Vim editor to create syntax highlighting. A
+helper script, `2context.vim` does the actual work.
+
+The idea of the module was germinated by Mojca Miklavec. She said (crica Sep
+2005):
+
+> I am thinking of piping the code to vim, letting vim process it, and return
+> something like `highlight[Conditional]{if} \highlight[Delimiter]{(}
+> \highlight[Identifier]{!}`.
+
+
+> One could modify the `2html.vim` file. Vim can already transform the highlighted
+> code to HTML, so ConTeXt should not be so difficult. Vim already has over 400
+> syntax file definitions, probably equivalent to some hundred thousand lines of
+> syntax definition in ConTexT. Well, I don't know (yet) how to do it, but if
+> someone on the last has more experience with vim, please feel free to
+> contribute.
+
+A few months later (circa Dec 2005), Nikolai Webull provided such a modification
+of `2html.vim` and called it `2context.vim`. That file was the foundation of
+`t-vim` module.
+
+About two years later (circa June 2008), Mojca and I (Aditya Mahajan) pickup up
+on this idea and released `t-vim`. Over the next few years, nothing much changed
+in the module, except a few minor bug fixes.
+
+Around June 2010, I decided to completely rewrite the module from scratch. It
+now uses the `t-filter` module behind the scenes for all the book-keeping of
+creating and maintaining external files.
+
+Installation
+------------
+
+You also need to install `t-filter` module.
+
+Basic Usage
+-----------
+
+The main macro of this module is `\definevimtyping`. Suppose you want to do
+syntax highlighting of ruby code in ConTeXt. For that you may use:
+
+ \definevimtyping [RUBY] [syntax=ruby]
+
+This defines an environment
+
+ \startRUBY
+ ...
+ \stopRUBY
+
+The contents of this environment are written to an external file, which is then
+parsed using vim, and the output is read back by ConTeXt.