Vimify your command line
Say you entered pretty long command into your shell but noticed an error in the middle. How do you fix that?
Well... What if you could, like in vi, switch from insert to normal mode and modify the input with vi key bindings?
You can do just that.
Put this in ~/.zshrc
bindkey -v
Now your command line is your insert mode. Press ESC to switch to normal mode.
But you're not limited to your shell. You can have the same functionality providing input in other places, like irb or pry, basically any place where readline is used.
Put this in ~/.inputrc
set editing-mode viWritten by Michał Szajbe
Related protips
1 Response
For those of us using bash, you can do the same thing with "set -o vi" in your .bash_profile. Thanks for the pro-tip!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#