Monday, November 19, 2012

Generating html drop down options with vim

:1,$ s:\(.*\):<option value="\1">\1</option>:g  

If the file contains 

1
2
3

This command will result in 
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>

No comments:

Blog Archive