When typing a complicated command that started on the command line in Bash, how do I switch to editing it with ViM?
I'm not sure you can do so in the middle of typing in the command, but you (at least in my experience) can switch to an 'emacs' or a 'vi' line-editing mode via
set -o emacs or
set -o vi respectively. Those commands will set keybindings for things like last-command, erase-word, erase-to-end-of-line, erase-to-start-of-line, etc.