I want to add this code:
<link rel="stylesheet" type="text/css" href="css/global.css" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="css/iehacks.css" />
<![endif]-->
to all the files in a folder right before the </head> tag
I would record a macro to insert the text, then do a :bufdo to apply it to all open files.
Example:
Open all files in vim, then record a macro in register x with
qx, go to the top of the file withgg, search for the end of the head-tag with/\/head, open a line before that withO(big O), then type or paste your text as usual, write your file with:w, end the recording withq.After that, run
:bufdo normal @xto apply it to all open buffers.