Reputation: 33
Is there a way for me to configure my vimrc so that, when writing a multi-line comment in C++, Java, or other languages, like
/* f
* o
* o
*/
, I could get the asterisk and space to appear whenever I'm in a comment and press return to start a new line?
If I have not worded my question well enough, please tell me.
Thank you in advance for any help.
Upvotes: 3
Views: 559
Reputation: 172510
That is controlled via 'formatoptions'
:
:set formatoptions+=r
To also enable this for o
and O
commands:
:set formatoptions+=o
See all available options at :help fo-table
.
Note that this depends on the correct 'comments'
setting, but the default already has the right definition for /* ... */
multiline comments.
Upvotes: 4