summaryrefslogtreecommitdiff
path: root/runtime/plugin/tohtml.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2004-06-13 20:20:40 +0000
committerBram Moolenaar <Bram@vim.org>2004-06-13 20:20:40 +0000
commit071d4279d6ab81b7187b48f3a0fc61e587b6db6c (patch)
tree221cbe3c40e043163c06f61c52a7ba2eb41e12ce /runtime/plugin/tohtml.vim
parentb4210b3bc14e2918f153a7307530fbe6eba659e1 (diff)
downloadvim-git-071d4279d6ab81b7187b48f3a0fc61e587b6db6c.tar.gz
updated for version 7.0001v7.0001
Diffstat (limited to 'runtime/plugin/tohtml.vim')
-rw-r--r--runtime/plugin/tohtml.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/runtime/plugin/tohtml.vim b/runtime/plugin/tohtml.vim
new file mode 100644
index 000000000..9914bed6d
--- /dev/null
+++ b/runtime/plugin/tohtml.vim
@@ -0,0 +1,27 @@
+" Vim plugin for converting a syntax highlighted file to HTML.
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2003 Apr 06
+
+" Don't do this when:
+" - when 'compatible' is set
+" - this plugin was already loaded
+" - user commands are not available.
+if !&cp && !exists(":TOhtml") && has("user_commands")
+ command -range=% TOhtml :call Convert2HTML(<line1>, <line2>)
+
+ func Convert2HTML(line1, line2)
+ if a:line2 >= a:line1
+ let g:html_start_line = a:line1
+ let g:html_end_line = a:line2
+ else
+ let g:html_start_line = a:line2
+ let g:html_end_line = a:line1
+ endif
+
+ runtime syntax/2html.vim
+
+ unlet g:html_start_line
+ unlet g:html_end_line
+ endfunc
+
+endif