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

More tcsh history command improvements UNIX
I've always hated the default command line completion settings in tcsh; they're too restrictive for me. I've been using JPSoftware's 4DOS/4NT command line processor on my Wintel PC for years and I love how they handle command completion. They have the TAB key cycle through all possible choices when there's more than one match, and they have the command history (up and down arrow keys) operate similarly. Also, if you simply type the name of a directory as the only argument on the command line, they treat it as the argument to the "cd" command and go to that directory.

You can make tcsh behave the same way by adding the following lines to your .tcshrc file:
# Make command completion (TAB key) cycle through all possible choices
# (The default is to simply display a list of all choices when more than one
# match is available.)

bindkey "^I" complete-word-fwd

# Make command history (arrow keys) use history search operations
# (The default is to simply display the next item in the history list.)

bindkey -k down history-search-forward
bindkey -k up history-search-backward

# Turn on implicit cd operation
set implicitcd
Check out the tcsh 'man' page; there's quite a lot in there.

[Editor's note: There are numerous other articles here that speak of where to save these commands in your user environment. For Apple's recommendation on the matter, type:
cat /usr/share/init/tcsh/README
This details the preferred structure on OS X.]
  • Currently 3.33 / 5
  You rated: 2 / 5 (6 votes cast)

More tcsh history command improvements | 2 comments | Create New Account
Click here to return to the 'More tcsh history command improvements' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
What is implicitcd?
Authored by: RandyMan on Feb 15, '02 11:06:34AM
Can anyone tell me what
# Turn on implicit cd operation
set implicitcd
actually does? I couldn't find anything about this in 'man tcsh'.

[ Reply to This | # ]
What is implicitcd?
Authored by: Anonymous on Feb 15, '02 12:19:38PM
I don't know what's wrong with your tcsh man page, but it's in mine:
       implicitcd (+)
               If set, the shell treats a directory name typed as
               a command as though it were a request to change to
               that  directory.  If set to verbose, the change of
               directory is echoed to the standard output.   This
               behavior  is  inhibited  in  non-interactive shell
               scripts, or for command strings with more than one
               word.   Changing  directory  takes precedence over
               executing a like-named command,  but  it  is  done
               after  alias  substitutions.   Tilde  and variable
               expansions work as expected.

Perhaps, you don't yet know about man page string searching?

Do a 'man tcsh' and then, while in man, type '/implicitcd' and it should take you to the first instance of that string. Hit the 'n' key to find the next instance.

Hope that helps!

[ Reply to This | # ]