Edit your commands in bash before running them
Writing long commands in bash is a PITA, escape to vim to make them shine!
Set EDITOR and VISUAL in your .bashrc to vim:
EDITOR=/usr/bin/vim
VISUAL=/usr/bin/vim
and when you need to delve in to a large command, hit Ctrl-X, then Ctrl-E and your vim will open up, and you can :wq your edited command to run it. Multi-line commands are run as multiple commands when you return to bash, as well.
Written by Ryan Rix
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#