Hi,

Tom Link wrote:
>>   let append = ' vim: set et ts='.&tabstop.' sw='.&shiftwidth.' 
>> tw='.&textwidth.': '
>>   let append = "\n" . substitute(&commentstring, '%s', append, '')
>>   $put =append
> 
> It's a matter of taste but the use of printf() somehow seem cleaner to
> me:
> 
> let vim = printf("vim: et:ts=%d:sw=%d:tw=%d", &ts, &sw, &tw)
> let vim = printf("\n". &commentstring, vim)
> $put =vim
> 
> You should be aware though that &commentstring isn't properly defined
> for all filetypes. Triggering a comment plugin could prove more useful.

what happens, if &commentstring contains a percent sign?

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to