My formatoptions include cro.
I have a filetype (Stata .do files) in which the comment character is *. Anything after this character is considered a comment line.
In insert mode *<CR>* leads to
*
* <cursor>
However **<CR> leads to
**
<cursor>
My desired behavior, which seems to work in most other filetypes in my configuration, is that **<CR> leads to
**
*<cursor>
What's wrong with this filetype and how can I fix it?
Another filetype example I found with similar behavior is Python. There if I do #<CR># I get
#
#<cursor>
But if I do ##<CR> I get
##
<cursor>
Instead of what I would expect, which is
##
#<cursor>
This seems to be the same behavior as with the Stata files except that in the Stata files vim also inserts a space after the *. In Python it doesn't add the space but still doesn't recognize ## as being a comment line.
**, which disables the comment; or maybe**simply means "start comment - end comment" and creates an empty comment in that language. – VanLaser Jan 25 '16 at 01:27