I really hate to write long commands in the shell. But luckily there's a command for that.
and your editor will open with the last command you executed.
Edit, save and leave the editor. The command will be executed
I use this little trick frequently. Hope you like it as well..