bash – using the vi mode more effectively.

2013-11-22 139 words 1 min read

Vi blogging bundle
Vi blogging bundle (Photo credit: pedro mg)

You can first set the bash mode to vi. This will enable some vim like features to bash. So, add this to .bashrc :

set -o vi

Once, you have done that then its time to get more out of the vi mode. First, check some things and set some interesting stuff.

#Display all the bindings :
bind -P

#Copy the current bindings and use it in inputrc:
bind -p |grep -v self-insert>~/.inputrc

In the inputrc, so generated, all the functions and macros not bound are commented with “#” and you can set them to your choice as in other examples.

And here is a link that can get you started.

http://www.catonmat.net/blog/bash-vi-editing-mode-cheat-sheet/

 

Enhanced by Zemanta

Related Articles:


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it