Last Updated: February 25, 2016
·
377
· celsodantas

Edit terminal command in Vim

Add this to bashrc/zshrc:

# Enables the edition of command lines!
# press cltr+x cltr+e to open the editor and fix any command line errors
autoload edit-command-line
zle -N edit-command-line
bindkey '^X^E' edit-command-line

Now in Bash/ZSH ctrl+x+e opens default editor (like vim) where you can prepare your command before executing.