summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/third/vim/2context.vim
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-02-07 00:17:28 +0000
committerKarl Berry <karl@freefriends.org>2011-02-07 00:17:28 +0000
commit6ed45e99f37edb7c8a4a7e03adf20f60b93b0319 (patch)
tree2a7b90b09d7128ff369dac17232ac52970f7ddcf /Master/texmf-dist/tex/context/third/vim/2context.vim
parent9771992141589e82ce1d540e026726b59004f44e (diff)
context-vim (7feb11)
git-svn-id: svn://tug.org/texlive/trunk@21319 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/third/vim/2context.vim')
-rw-r--r--Master/texmf-dist/tex/context/third/vim/2context.vim25
1 files changed, 13 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/context/third/vim/2context.vim b/Master/texmf-dist/tex/context/third/vim/2context.vim
index 7e2f32864a5..533a116983e 100644
--- a/Master/texmf-dist/tex/context/third/vim/2context.vim
+++ b/Master/texmf-dist/tex/context/third/vim/2context.vim
@@ -1,15 +1,12 @@
-" Author : Aditya Mahajan
-" version : 0.2
+" Author : Aditya Mahajan <adityam [at] umich [dot] edu>
+" version : 2011.02.05
+" license : Simplified BSD License
-" This script converts the syntax highlighting of a file to ConTeXt. This file
-" is based on 2html.vim.
+" This script is part of the t-vim module for ConTeXt. It is based on 2html.vim.
+" It assumes that two buffers are open. The first buffer is the output buffer,
+" and the second buffer is the input buffer.
-" Create a new buffer with .vimout extension
-if expand("%") == ""
- new texput.vimout
-else
- new %:r.vimout
-endif
+" We move back and forth between the buffers,
" Make sure that the buffer is modifiable
set modifiable
@@ -17,8 +14,8 @@ set modifiable
" ... and empty
%d
-" Go to previous buffer
-wincmd p
+" Go to the last buffer
+sblast
" Loop over all lines in the original text.
" Use contextstartline and contextstopline if they are set.
@@ -36,6 +33,8 @@ if exists("contextstopline")
let s:end = contextstopline
if !(s:end >= s:lnum && s:end <= line("$"))
let s:end = line("$")
+ elseif s:end < 0
+ let s:end = line("$") - s:end
endif
else
let s:end = line("$")
@@ -114,3 +113,5 @@ endwhile
wincmd p
" We have a spurious line in the end. So we remove it.
$delete
+" Write the file
+write