See the doc (`info zsh widgets`):
> User-defined widgets, being implemented as shell functions, can execute any normal shell command. They can also run other widgets (whether built-in or user-defined) using the zle builtin command. **The standard input of the function is redirected from /dev/null to prevent external commands from unintentionally blocking ZLE by reading from the terminal** , but read -k or read -q can be used to read characters. Finally, they can examine and edit the ZLE buffer being edited by reading and setting the special parameters described below.
Here, you can _undo_ that by doing:
vim_hist() {
n=$(sed -n "s|~|$HOME|;s|^> \(.*\)|\1|p" ~/.vim/viminfo | fzf)
if [ "$n" != "" ] && [ -f "$n" ]; then
vim < /dev/tty $n
zle -I
fi
}
(also calling `zle -I` to invalidate the prompt so it be redrawn upon return of `vim`)