In vim, many syntax elements automatically get inserted on the next line when I start a newline. For example, if I am inside a vim file editing a comment in insert mode, when I go to the next line, I will see the " character inserted at the appropriate indent level so I can continue my comment. I want to know how this is done inside a vim syntax file.
As a more concrete example, let's suppose that I want to make a syntax file that recognizes a bulleted list (using * as the bullet). I could add a simple match expression
syntax match Bullet /^\s*\*\ /
I can then highlight that bullet with something like
highlight link Bullet Statement
However, after I complete one bullet point, and hit enter to go to the next line, I need to add something else to get it to automatically add a * before my cursor. Obviously this should take place within the context of the automatic indenting. What exactly do I need to do in order for this syntax insertion to take place?