Learning The Vi and Vim Editors 7th (Paperback)
To learn the basics, vimtutor is enough, but for progress, this book is a nugget. The treatment of especially macros deserves careful reading and gave me a lot of time for all of repetitive editing tasks, but to write a script which would be too long