VIM: questions about 'set comments'

VIM: questions about 'set comments'

Post by Ben Alle » Tue, 07 Jan 2003 17:35:42



I have a couple of interrelated questions about how the 'set comments' option
works. First of all, I'm sort of trying my hand at writing an indent file for
the text-adventure programming language Inform, which uses ! to mark comments.
I'm assuming the indent file is an inappropriate place to put it (mainly just
because grepping in the $VIMRUNTIME/indent directory only returns one result out
of all the however many different indent files. Would any other location be more
correct?

Second, even if I set a line like:

set comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-,:\",:\!

in my .vimrc (to add " and ! as comment markers), I find :set comments
returning just

comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-  

whenever I load a file with a filename/extension known to vim. So, for example,
if I'm editing a file named "foo", I'll get the comments string from my vimrc,
but if I'm editing inform.vim, or foo.c, or even .article I'll get the truncated
one. What could be causing this to happen? I'm absolutely stumped.
--

"Heaven is a place where nothing ever happens." -David Byrne, Talking Heads
"The internet is a place where absolutely nothing happens."
-Strong Bad, homestarrunner.com

 
 
 

VIM: questions about 'set comments'

Post by Pepp » Sat, 11 Jan 2003 05:48:53



Quote:> I have a couple of interrelated questions about how the 'set comments' option
> works. First of all, I'm sort of trying my hand at writing an indent file for
> the text-adventure programming language Inform, which uses ! to mark comments.
> I'm assuming the indent file is an inappropriate place to put it (mainly just
> because grepping in the $VIMRUNTIME/indent directory only returns one result out
> of all the however many different indent files. Would any other location be more
> correct?

I'd rather put it in an ftplugin file, say ~/.vim/after/ftplugin/inform.vim .

Quote:> Second, even if I set a line like:
> set comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-,:\",:\!
> in my .vimrc (to add " and ! as comment markers), I find :set comments
> returning just
> comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-  

That looks like the default value for 'comments'. You can check where
it was last set with

    :verbose set comments?

If that does not give you a sufficient clue, report back and someone
here might be able to figure it out.

Peppe
--
                                      "Before you criticize someone, walk
Preben "Peppe" Guldberg  __/-\__       a mile in his shoes. That way, if

----------------------oOOo (_) oOOo--  - and barefoot."    --Sarah Jackson

 
 
 

1. 'set number' in vim question

I just started using vim 5.3 on an HPUX 10.2 workstation.  I'm a little
puzzled as
to why a set number command causes underscores to appear in the line
number field.
The syntax command does this on my terminal window but I'm not using
that
option.  I also can't see how the hightlight command might be causing
this.  Any
help in where the underscores are coming from (so I can get rid of them)
would
be appreciated, thanks.

Tim Morse

2. Scrollbar Hell

3. vim: '#' comments

4. thebibliography - different "sections"?

5. VIM: 'set'ing an option to the contents of a variable

6. Upgrade normal server to BDC

7. vim 6.1 - set undolevels 'n' config file

8. Emacs implementations, regular post [long]

9. Why does vim change 'lines' value in typing :set guioptions-=m?

10. Full ''Amstrad Action'' set to auction

11. vim 6 - search w/ 'ic', substitute w/ 'noic'

12. VIM: Why is 'dd' slower than ':d'?

13. Comments on 'PB 4.0 A Developer's Guide' by David Mclanahan?