I am trying to have some additional lines inserted in snippets based on a parameter. I am not sure how design such snippet.
snippet 'mysnip' 'snippets with optional lines'
This snippet line1 is inserted by default
<This line1a should be inserted if parameter1 is true>
This snippet line2 is inserted by default
<This line2a should be inserted if parameter1 is true>
endsnippet
It is not very clear to me how/where you want to enter your parameters.
One option is to define two snippets, one called
mysnipand the other onemysnip1- in this case you pass the parameter in the snippet name, and the definition of these two snippets should be straightforward.Another option is to just define one snippet
mysnip, and pass the parameter somewhere within this snippet. A working example could look like this: