Bash provides some editor integration to ease writing of long, complex commands.
ctrl x ctrl e will bring up an editor to write a new command. Upon saving and exiting, it gets executed.
fccommand opens an editor to edit the previous command.
I knew about the keybinding, but I learned of
fc fairly recently. If you use a
powerful command-line editor, it's game-changing, specially when dealing with
long pipes and/or regular expressions.