4

I'd like to extends this function to work as usual in most cases but if current line starts with * then it should indent and then insert *. Particularly i want to use it in multi line comments, i.e:

/**
  * multiline comment
  */

So when i press Ret, while writing a comment, it would add *.

4lex1v
  • 603
  • 3
  • 12
  • This doesn't answer your question, but if you just write one long line and then hit M-q the comment will be broken into several lines in the appropriate way. – Malabarba Nov 12 '14 at 16:46

1 Answers1

3

I think the command you want to use is comment-indent-new-line which is normally bound to M-j.

Stefan
  • 26,404
  • 3
  • 48
  • 85