Is there a Vim plugin that can handle smart semicolon insertion, like the one in Eclipse?
Example (pipe character is insertion cursor):
foobar(|)
" ftplugin/c/c_snippet.vim
inoremap ; getline('.')[col('.')-1:-1]=~')$' ? ';' : ';'
This version shall not pose problems with for if your snippets engine expands it into
for (...|) {
<+code+>
}<++>
If the open bracket is on a newline, it will mess things up.
You could easily change the regex to '"\=)\+$' to answer your initial question.
inoremap ; getline('.')[col('.')-1:-1]=~'"\=)\+$' ? ';' : ';'
However, I don't think it's a good idea. In that case, the mapping for will be:
inoremap getline('.')[:col('.')-2] =~ '.*")\+;$' ? 'F";' : ''