0

I'm trying to understand how Ultisnips works (very few documentation when you're a beginner like me) and in the all.snippets code there a function that returns vim.eval("&comments")

So I'm trying to guess how this works, and if I try:

:let g=eval("&comments")
:echo g

I get this: s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- when i'm in the snippet file.

If I open up a an empy Php file and try the previous code I get s:<!--,m: ,e:-->

I want to have the classical comment like this /* */ configured to that I could call the sample snippet "box" (it works but adds <!-- --> = HTML comment delimiters instead of actual Php comment delimiters).

How can I guess when it's assigned, and how to change <!-- --> to /* */?

Olivier Pons
  • 15,363
  • 26
  • 117
  • 213

1 Answers1

2

You want to use commentstring instead of comments. The former is set to the correct valus in php.

Roland Smith
  • 42,427
  • 3
  • 64
  • 94
  • According to vim help: `comments` is a comma separated list of strings that can start a comment line, whereas `commentstring` is a *template* for a comment. So they are not made for the same goal. – Olivier Pons Jul 11 '14 at 09:06