On 8/19/06, Meino Christian Cramer <[EMAIL PROTECTED]> wrote:
Suppose the following piece of C-code:
/*
* This is a comment
* It does say nothing []
The "[]" marks the current cursor position.
When hitting <RET> in this situation, Mr. Cursor will jump
right below the prevous lines "*" adding another "* " to continue
the comment -- not knowing, that the programmer has finished the
comment already and wants to start programming "real code" ;) .
Well you need to close the commen before writing "real code".
How about typing */ or a / after * before writing "real code" ?
Would it possible (or isit already possible) to convince vim from
Rule 2: When Mr. Cursor is positioned in a comment line containing
only a '*' and <RET> is entered close the lonely '*'of the
current line with a '/' and jump into the next line without
adding anothe '*'
It is possible but my guess is, it's useful only for you.
Because block comments happen to have embedded
"empty lines" which look look this:
/*
* bla-bla-bla.
*
* Another paragraph starts here bla-bla-bla.
*/
I guess you need to close comment first before writing code.
If typing / and <Enter> is too much typing for you, then you
can map it to Alt-something or control-something.
Yakov