edit-and-execute-command

bash

>What

Press Ctrl-x, Ctrl-e in the terminal when writing a long command.

>Why

So you can edit it (in multi-line mode) with your favorite editor.

>Reference

The Bash manual’s section on miscellaneaous commands: reference

edit-and-execute-command (C-x C-e)

Invoke an editor on the current command line, and execute the result as shell commands. Bash attempts to invoke $VISUAL, $EDITOR, and emacs as the editor, in that order.