Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'try bindkey' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
try bindkey
Authored by: awk on Oct 14, '02 01:09:42PM

the hint is just the tip of the iceberg...

Type "bindkey" and you can see all the key bindings in the shell (which you can change, see "man tcsh" for details). Type "bindkey -l" (dash ell) to see short descriptions.

(The "^[" character means you press escape and/or use option, ^X means control-X, etc.)

Here are some I use a lot:

Control-T will transpose the two letters under the cursor. Handy for those "tpyos"..

Esc-Delete will delete the word before the cursor (and then Control-Y can be used to paste it again someplace else). In fact there are lots of cut and paste (kill and yank) commands.

Control-X asterisk (^X*) will expand the sell wildcard you just typed. For instance if you type "rm *" and then "^X*" the star will be expanded to the list of files. Handy if you want to do something to most of the files in a directory but not all. Just expand and then eliminate the ones you don't want.

Esc-L/Esc-U will lowercase/upcase from the cursor to the end of the word.

My favorite is "history search" (Esc-n/Esc-p by default). This lets you type, for example, "defaults " and then hit the keys and it will scroll through all commands in your history that start with "defaults". This is so useful I rebound it to up/down arrow.

You can also set the keys to arbitrary strings, for instance (type it like you see it, carets and all):

bindkey -s "^X^B" "man tcsh^M"

Now ^X^B will give you the tcsh manual,,, you could even bind keys to applescripts using osascript .. skip to the next itunes track from the shell ....

All kinds of stuff in there...........



[ Reply to This | # ]
try bindkey
Authored by: VEGx on Oct 14, '02 04:01:11PM

Cool! I new I was on something when I submitted it :)



[ Reply to This | # ]