I am trying to make a new custom command in my .vimrc, so that when I type
:Hcom
the command will convert the text of the current line into an HTML comment.
As an example:
abcdef
:Hcom
<!-- abcdef -->
I do not want to use a macro nor a mapping. The equivalent macro would be
let @h = '0i<\!-- ^[A -->^['
I cannot find out how to do this. Is it at all possible without a script? I tried the following, with and without escapes, without success:
:command Hcom put='0i<\!-- ^[A -->^['