I have this line in mine ~/.vimrc, which does exactly what you want:
nnoremap <leader>g I/* <Esc>A */<Esc>yyp0llv$r-$hc$*/<Esc>yykPjj
Place the cursor on the line, click <leader>gdone.
The default <leader>value is equal \, therefore it will be \g.
You can obviously use any shortcut you need.
source
share