comparison runtime/doc/syntax.txt @ 5003:ad6996a23e3e

Updated runtime files. New version of TOhtml plugin.
author Bram Moolenaar <bram@vim.org>
date Wed, 26 Jun 2013 13:28:14 +0200
parents ceb5f21cda79
children 7a2ffd685c0e
comparison
equal deleted inserted replaced
5002:2f5a78a77361 5003:ad6996a23e3e
1 *syntax.txt* For Vim version 7.3. Last change: 2013 Jun 24 1 *syntax.txt* For Vim version 7.3. Last change: 2013 Jun 26
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
377 377
378 378
379 2HTML *2html.vim* *convert-to-HTML* 379 2HTML *2html.vim* *convert-to-HTML*
380 380
381 This is not a syntax file itself, but a script that converts the current 381 This is not a syntax file itself, but a script that converts the current
382 window into HTML. Vim opens a new window in which it builds the HTML file. 382 window into HTML. Vim opens a new window in which it builds the HTML file.
383 383
384 After you save the resulting file, you can view it with any browser. The 384 After you save the resulting file, you can view it with any browser. The
385 colors should be exactly the same as you see them in Vim. You can jump to 385 colors should be exactly the same as you see them in Vim. With
386 specific lines by adding (for example) #L123 or #123 to the end of the URL in 386 |g:html_line_ids| you can jump to specific lines by adding (for example) #L123
387 your browser's address bar (#123 only with javascript support). And with 387 or #123 to the end of the URL in your browser's address bar. And with
388 |g:html_dynamic_folds| enabled, you can show or hide the text that is folded 388 |g:html_dynamic_folds| enabled, you can show or hide the text that is folded
389 in Vim. 389 in Vim.
390 390
391 You are not supposed to set the 'filetype' or 'syntax' option to "2html"! 391 You are not supposed to set the 'filetype' or 'syntax' option to "2html"!
392 Source the script to convert the current file: > 392 Source the script to convert the current file: >
423 This command will source |2html.vim| for you. When a 423 This command will source |2html.vim| for you. When a
424 range is given, set |g:html_start_line| and 424 range is given, set |g:html_start_line| and
425 |g:html_end_line| to the start and end of the range, 425 |g:html_end_line| to the start and end of the range,
426 respectively. Default range is the entire buffer. 426 respectively. Default range is the entire buffer.
427 427
428 If the current window is part of a |diff|, unless 428 If the current window is part of a |diff|, unless
429 |g:html_diff_one_file| is set, :TOhtml will convert 429 |g:html_diff_one_file| is set, :TOhtml will convert
430 all windows which are part of the diff in the current 430 all windows which are part of the diff in the current
431 tab and place them side-by-side in a <table> element 431 tab and place them side-by-side in a <table> element
432 in the generated HTML. When this happens you can jump 432 in the generated HTML. With |g:html_line_ids| you can
433 to lines in specific windows with (for example) #W1L42 433 jump to lines in specific windows with (for example)
434 for line 42 in the first diffed window, or #W3L87 for 434 #W1L42 for line 42 in the first diffed window, or
435 line 87 in the third. Omitting the window ID will 435 #W3L87 for line 87 in the third.
436 default to the first window if javascript is enabled.
437 436
438 Examples: > 437 Examples: >
439 438
440 :10,40TOhtml " convert lines 10-40 to html 439 :10,40TOhtml " convert lines 10-40 to html
441 :'<,'>TOhtml " convert current/last visual selection 440 :'<,'>TOhtml " convert current/last visual selection
442 :TOhtml " convert entire buffer 441 :TOhtml " convert entire buffer
443 < 442 <
444 *g:html_diff_one_file* 443 *g:html_diff_one_file*
445 Default: 0. 444 Default: 0.
446 When 0, all windows involved in a |diff| in the current tab page are converted 445 When 0, and using |:TOhtml| all windows involved in a |diff| in the current tab
447 to HTML and placed side-by-side in a <table> element. 446 page are converted to HTML and placed side-by-side in a <table> element. When
448 When 1, only the current buffer is converted. 447 1, only the current buffer is converted.
449 Example: > 448 Example: >
450 449
451 let g:html_diff_one_file = 1 450 let g:html_diff_one_file = 1
452 < 451 <
453 *g:html_whole_filler* 452 *g:html_whole_filler*
493 Force to omit the line numbers: > 492 Force to omit the line numbers: >
494 :let g:html_number_lines = 0 493 :let g:html_number_lines = 0
495 Go back to the default to use 'number' by deleting the variable: > 494 Go back to the default to use 'number' by deleting the variable: >
496 :unlet g:html_number_lines 495 :unlet g:html_number_lines
497 < 496 <
497 *g:html_line_ids*
498 Default: 1 if |g:html_number_lines| is set, 0 otherwise.
499 When 1, adds an HTML id attribute to each line number, or to an empty <span>
500 inserted for that purpose if no line numbers are shown. This ID attribute
501 takes the form of L123 for single-buffer HTML pages, or W2L123 for diff-view
502 pages, and is used to jump to a specific line (in a specific window of a diff
503 view). Javascript is inserted to open any closed dynamic folds
504 (|g:html_dynamic_folds|) containing the specificed line before jumping. The
505 javascript also allows omitting the window ID in the url, and the leading L.
506 For example: >
507
508 page.html#L123 jumps to line 123 in a single-buffer file
509 page.html#123 does the same
510
511 diff.html#W1L42 jumps to line 42 in the first window in a diff
512 diff.html#42 does the same
513 <
498 *g:html_use_css* 514 *g:html_use_css*
499 Default: 1. 515 Default: 1.
500 When 1, generate valid HTML 4.01 markup with CSS1 styling, supported in all 516 When 1, generate valid HTML 4.01 markup with CSS1 styling, supported in all
501 modern browsers and most old browsers. 517 modern browsers and most old browsers.
502 When 0, generate <font> tags and similar outdated markup. This is not 518 When 0, generate <font> tags and similar outdated markup. This is not
601 normal CSS1 styling so that the folds show up correctly for this browser, but 617 normal CSS1 styling so that the folds show up correctly for this browser, but
602 they will not be openable without a foldcolumn. 618 they will not be openable without a foldcolumn.
603 > 619 >
604 :let g:html_hover_unfold = 1 620 :let g:html_hover_unfold = 1
605 < 621 <
622 *g:html_id_expr*
623 Default: ""
624 Dynamic folding and jumping to line IDs rely on unique IDs within the document
625 to work. If generated HTML is copied into a larger document, these IDs are no
626 longer guaranteed to be unique. Set g:html_id_expr to an expression Vim can
627 evaluate to get a unique string to append to each ID used in a given document,
628 so that the full IDs will be unique even when combined with other content in a
629 larger HTML document. Example, to append _ and the buffer number to each ID: >
630
631 :let g:html_id_expr = '"_".bufnr("%")'
632 <
633 To append a string "_mystring" to the end of each ID: >
634
635 :let g:html_id_expr = '"_mystring"'
636 <
637 Note, when converting a diff view to HTML, the expression will only be
638 evaluated for the first window in the diff, and the result used for all the
639 windows.
640
606 *TOhtml-wrap-text* *g:html_pre_wrap* 641 *TOhtml-wrap-text* *g:html_pre_wrap*
607 Default: current 'wrap' setting. 642 Default: current 'wrap' setting.
608 When 0, if |g:html_no_pre| is 0 or unset, the text in the generated HTML does 643 When 0, if |g:html_no_pre| is 0 or unset, the text in the generated HTML does
609 not wrap at the edge of the browser window. 644 not wrap at the edge of the browser window.
610 When 1, if |g:html_use_css| is 1, the CSS 2.0 "white-space:pre-wrap" value is 645 When 1, if |g:html_use_css| is 1, the CSS 2.0 "white-space:pre-wrap" value is