Is there really an advantage to using Ed instead of vim in any situation whatsoever? (Assuming you're totally comfortable with vim)
But if you're totally comfortable with vim you'd better use ex, which basically is both an extension to ed, and the non-interactive part of vim.