I'm trying to convert a bunch of .textile files into their equivalent .markdown files.
I would like a vim search/replace command to replace all h1., h2., h3., etc. patterns with the associated number of # characters. So, h1. would become #, h2. would be come ## and so forth.
I think what I want to use is the \=repeat command, but I'm a bit lost as to what arguments to pass it.
Here is what I have so far. It replaces the correct matches, but it just deletes them and gives me errors:
:1,$s/h\d./\=repeat('#',submatch(0))
What are the proper arguments to pass to the \=repeat command?