You can use yasnippet for insertion and overwrite-mode for editing.
If you need word wrap, you can also kill the rectangle Cx rk , switch to the temporary buffer Cx b , yank the rectangle Cx ry . Edit your heart content there. After that, kill the rectangle from the temporary buffer and paste it into your source.
Here is a fragment of the beginning / end of the block:
# -*- mode: snippet -*- # name: block comment # key: bb # -- `(concat "#" (make-string (- 80 aya-tab-position) ?*) "#")` $0 `(concat "#" (make-string (- 80 aya-tab-position) ?*) "#")`
Here's a snippet of a block line:
# -*- mode: snippet -*- # name: block comment line # key: bl # -- `"#* "`$1${1:$(make-string (- 78 aya-tab-position (length text)) ? )}#
Note that I am using the auto-yasnippet aya-tab-position package variable here. To use it in a fragment, you need to expand the fragment with aya-open-line . You can get both packages from MELPA.
source share