My os: debian8.
uname -a Linux debian 3.16.0-4-amd64
Here is my base file.
home help variables compatibility modelines searching selection markers indenting reformatting folding tags makefiles mapping registers spelling plugins etc
I want to create an html file as shown below.
<a href="home.html" id="home">home</a> <a href="help.html" id="help">help</a> <a href="variables.html" id="variables">variables</a> <a href="compatibility.html" id="compatibility">compatibility</a> <a href="modelines.html" id="modelines">modelines</a> <a href="searching.html" id="searching">searching</a> <a href="selection.html" id="selection">selection</a> <a href="markers.html" id="markers">markers</a> <a href="indenting.html" id="indenting">indenting</a> <a href="reformatting.html" id="reformatting">reformatting</a> <a href="folding.html" id="folding">folding</a> <a href="tags.html" id="tags">tags</a> <a href="makefiles.html" id="makefiles">makefiles</a> <a href="mapping.html" id="mapping">mapping</a> <a href="registers.html" id="registers">registers</a> <a href="spelling.html" id="spelling">spelling</a> <a href="plugins.html" id="plugins">plugins</a> <a href="etc.html" id="etc">etc</a>
The href and id attributes were added to each line, the values ββof which are the contents of the lines, the inserted .html and accordingly the contents of the line.
How to quickly add html attributes and values ββfor all lines using vim and plugins?
sed, awk, sublime text 3 are welcome to solve the problem.
source share