SpicyCode

The ramblings of Chad Humphries

Getting your keys tied and bound in ZSH

leave a comment »

Let’s take a little trip down to shell-ville. It’s a small town down on the coast where the locals still like to know the nitty gritty details of how their operating systems work.

Today we are going to visit Bind Key park. It’s said you can make almost anything happen there with just a keystroke or two. Why what’s this? It seems a local orator is giving a speech on the parks heritage.

To clear the line you must press Control-K.


bindkey '^K'

Lost at the end of the line? Go to the beginning with Control-A


bindkey "^A"

Having the opposite issue? Go to the end of the line with Control-E


bindkey "^E"

What’s more, you can search through your history backwards using Control-R!


bindkey "^R"

Not enough for you, how about just pressing Down?


bindkey "[B": history-search-forward

Fine, not easily impressed eh? Up will search your history back in time?


bindkey "[A": history-search-backward

Hmm, he does seem convincing. I’ve recorded the most informative bits in this post for all to see. If you wish to use this knowledge carefully inscribe it into your .zshrc file.

Advertisements

Written by spicycode

October 21, 2008 at 7:56 pm

Posted in programming

Tagged with

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: