1 " Vim filetype detection file
3 " Author: Stuart Rackham <srackham@gmail.com>
4 " Last Change: AsciiDoc 8.2.0
5 " URL: http://www.methods.co.nz/asciidoc/
6 " Licence: GPL (http://www.gnu.org)
7 " Remarks: Vim 6 or greater
9 " COMMENT OUT ONE OF THE TWO FOLLOWING COMMANDS
10 " The first sets asciidoc syntax highlighting on all .txt files, the second
11 " only existing files *.txt that appear to be AsciiDoc files.
13 au BufNewFile,BufRead *.txt,README,TODO,CHANGELOG,NOTES setfiletype asciidoc
14 "au BufRead *.txt,README,TODO,CHANGELOG,NOTES call s:FTasciidoc()
16 " This function checks for a valid AsciiDoc document title after first
17 " skipping any leading comments.
18 function! s:FTasciidoc()
19 let in_comment_block = 0
26 let in_comment_block = 1
28 let in_comment_block = 0
35 if line !~ '\(^//\)\|\(^\s*$\)'
44 if line !~ '[-=]\{3,}'
47 if len < len(line) - 3 || len > len(line) + 3
53 " vim: et sw=2 ts=2 sts=2: