Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/vim71/plugin/tohtml.vim
blob: 9914bed6d3ea1acb12266f05807e52fdc4282c56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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