Q: how do I get yasnippet to insert the comment sign, when I press return to start new line?
For example, my snippet looks like this
;; $1 .
;; / END
$2
When the cursor is on the $1, and I'm typing some text, I would like to press return.
It will start a new line, but the ;;
is missing on the new line.
I found nothing on this specific issue. I could also use elisp forms to create a new mapping on the new line, like (concat comment-start), but it's not clear to me how to expand them appropriately.
See the comment below.
M-j
(indent-new-comment-line
) give you behavior that you want?(indent-new-comment-line)
inside the snippet, it will begin a new line, but without comment tag.