On Sep 17, 2:55 pm, Tony Mechelynck <[EMAIL PROTECTED]>
wrote:
> krischik wrote:
> > On 17 Sep., 13:10, thomas <[EMAIL PROTECTED]> wrote:
> [...]
> ftplugin/html.vim sets 'commentstring' to <!--%s-->
>
> ftplugin/vim.vim sets it to "%s (i.e., quote percent ess).
>
> So the only two languages which I use day-in day-out "seem" to set the correct
> value -- and neither is Ada or uses C-style comments.
Ok how about some statistik:
95 of the 150 ft-plug-ins set commentstring correctly.
1 of the 500 syntax-plug-ins set commentstring.
The current NERD_Commenter supports 325 filetypes.
If NERD_Commenter was relying on the 'commentstring' then it could
only support about 1/3 of the filetypes it know about.
But more importantly: This again speaks for filetype.bundles. There
are 500 syntax-plug-ins vs. 150 ft-plug-ins. And a simple ft-plug-in
is far easier to write then a syntax plugin. Here an examle for a
Wiki ft-plug-in I write:
----------------------------------------------------------------------------------
if exists ("b:did_ftplugin") || version < 700
finish
endif
" Don't load another plugin for this buffer
let b:did_ftplugin = 01
"
" Temporarily set cpoptions to ensure the script loads OK
"
let s:cpoptions = &cpoptions
set cpoptions-=C
" Section: File-Option {{{1
"
setlocal encoding=utf-8
setlocal wrap
setlocal smartcase
setlocal noignorecase
" Section: Comments {{{1
"
setlocal comments=O:{html}<!--
setlocal commentstring={html}<!--\ %s\ -->{html}
setlocal complete=.,w,b,u,t,i
set foldmethod=syntax
" 1}}}
" Reset cpoptions
"
let &cpoptions = s:cpoptions
unlet s:cpoptions
finish " 1}}}
----------------------------------------------------------------------------------
This is why I think bundles (at least for filetypes) would be a good
idea.
Martin
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---