Why don't you use a BibTeX manager, like JabRef, instead of coding your bib file by hand? In addition to not having to worry about missing commas, etc., JabRef takes care of telling you which fields are required, optional, etc.
Also, for your \emph
command, I'd suggest this instead:
nnoremap <leader>em ciw\emph{^R^O"} vnoremap <leader>em c\emph{^R^O"}
where ^R
and ^O
are literals, which you can insert by typing <C-v><C-r>
and <C-v><C-o>
, respectively. See :h i_CTRL-V
and :h i_CTRL-R_CTRL-O
.
Also, you could use cw
(or caw
) instead of ciw
, that way your macro can take a count number, e.g. 3<leader>em
. And you might want to have another version <leader>EM
(or whatever) that uses W
instead of w
, to deal with words like don't.
I haven't used it in a long time, but I think JabRef and its competitors can at least kinda-sorta do what you want...they import and export BIB files, and are usually pretty forgiving of errors so doing and round-trip ought to give you a compliant file.
I'm curious why you've separated your bibliography into multiple BIB files.
After trying a few tools several years ago I've started using JabRef, which basically functions as a frontend manager for .bib-files. It can automatically import PDFs and create .bib-entries for them, supports e.g. DOI and arXiv metadata lookup, and since the whole library metadata (together with links to the actual PDF files) is stored in a .bib-file and there is no extra database, BibTeX integration for LaTeX documents is built-in by design, which I really liked.
Just like Zotero or Mendeley, it has a browser extension that you can use to import sources.
It is also free and open-source.
I think it's compatible you just have to enable it in the settings then it creates a .bib file you can use with LaTeX.
But I would recommend JabRef it was created for BibTeX/BibLaTeX and is open source.