Background
I have a code file and I like to place comments inside my code. Sometimes, these comments are boxed:
defmodule BananasModule do
##############
# Public API #
##############
def function_blabla do .....
end
Objective
My objective is to have a key sequence (a macro, for example) that surrounds the line I am at with a boxed comment. For example, given the following file:
defmodule BananasModule do
<cursor> Public API
def function_blabla do .....
end
After using some command, I would ideally get:
defmodule BananasModule do
##############
# Public API #
##############
end
Do notice how the comment box is indented. This is very important.
What I have tried
I have tried out the NERDCommenter plugin, but unfortunately it doesn't have this feature.
I have also tried to create a macro following this discussion:
:let @a = "I## \<Esc>A ##\<Esc>yyPVr#jpVr#"
But the commend box I get after executing @a
is not indented:
defmodule BananasModule do
####################
## Public API ##
####################
end
Problem
Although I feel like I came close, I don't know enough about macros and configurations to make my comment boxes indented.