Lookup data while in mysql cli edit mode (external editor) (\e)
Well, sort of.

In vim, save your work to a different file...

:w myfile.sql [enter]


Then exit vim with an artificial error so the mysql client won't bother to re-read the temporary file.

:cq [enter]


Then clear the input buffer in mysql.

\c [enter]


Then do what you've gotta do.

Then re-launch vim

\e [enter]


The editor will have your last command in it.  Clear that out and then paste the temporary file back into the buffer.

:r myfile.sql [enter]


Keep editing, then save and exit and your new content will be returned to mysql for execution.