Hi Lugman

AsciiDoc used tro have a Vim ftdetect script but it was dropped because
file content detection was to hit-and-miss.  The asciidoc.vim syntax
file si now in the Vim distribution as a result of this issue raised by
Dan Allen:
https://code.google.com/p/vim/issues/detail?id=100

The current version of asciidoc.vim in the trunk
(https://code.google.com/p/asciidoc/source/browse/vim/syntax/asciidoc.vim)
is the same as in the Vim distribution
(https://code.google.com/p/vim/source/browse/runtime/syntax/asciidoc.vim),


Cheers, Stuart


On 14/09/13 12:01, Luqman Munawar wrote:
> In /usr/share/vim/vim73/filetype.
> vim I see following autocommand
> 
> au BufNewFile,BufRead *.txt,*.text        setf text
> 
> This means that that *.txt files are already set to filetype "text".
> Now the setfiletype in asciidoc_filetype.vim cannot reset the filetype.
> 
> I see no problem in changing the "setfiletype asciidoc" at the end of
> successful detection of the AsciiDoc file to "set filetype=asciidoc"
> 
> Here is the patch:
> 
> --- asciidoc_filetype.vim.orig    2013-09-14 01:57:38.868457046 +0200
> +++ asciidoc_filetype.vim    2013-09-14 01:56:44.716188524 +0200
> @@ -10,8 +10,8 @@
>  " The first sets asciidoc syntax highlighting on all .txt files, the second
>  " only existing files *.txt that appear to be AsciiDoc files.
>  
> -au BufNewFile,BufRead *.asciidoc,*.txt,README,TODO,CHANGELOG,NOTES 
> setfiletype asciidoc
> -"au BufRead *.txt,README,TODO,CHANGELOG,NOTES call s:FTasciidoc()
> +"au BufNewFile,BufRead *.asciidoc,*.txt,README,TODO,CHANGELOG,NOTES 
> setfiletype asciidoc
> +au BufRead *.asciidoc,*.txt,README,TODO,CHANGELOG,NOTES call s:FTasciidoc()
>  
>  " This function checks for a valid AsciiDoc document title after first
>  " skipping any leading comments.
> @@ -47,7 +47,7 @@
>    if len < len(line) - 3 || len > len(line) + 3
>      return
>    endif
> -  setfiletype asciidoc
> +  set filetype=asciidoc
>  endfunction
>  
>  " vim: et sw=2 ts=2 sts=2:
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "asciidoc" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/asciidoc.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/asciidoc.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to