I edit quite a few BibTeX files, and I regularly forget the trailing commas:
For example:
@Book{cooke2015british,
author = {Cooke, Lez},
title = {British Television Drama},
publisher = {Palgrave on behalf of the British Film Institute},
year = {2015},
keywords = {about}
address = {London},
isbn = {978-1844576234}
}
You'll see that I forgot to add the comma after keywords = {about}
, which will mean that I have to spend time debugging. Is there a way Vim can make me remember? By the way, I have the bib_autocomp.vim plugin ...
:%s/[^ ,]\zs\ze\n\s*[^ }]/,/
.