bindkey [instring [outstring | command]]
where instring is the key sequence, outstring is the key sequence to be produced, and
command is a command to bind to the specified key sequence.Below is a table showing some of the emacs key bindings and a brief description of each.
Key Brief Description Key Brief Description ------------------------------------------------------------------------------- [Up Arrow] Up 1 command in history [Down Arrow] Down 1 command in history [Right Arrow] Forward one character [Left Arrow] Back one character [CTRL][A] Go to beginning of line [CTRL][D] Delete character [CTRL][E] Go to end of line [CTRL][H] Delete back one char [CTRL][I] Complete the file name [CTRL][K] Delete to end of line [CTRL][L] Issues a clear command [CTRL][R] Redisplay the screen [CTRL][S] tty-stop-output [CTRL][Q] tty-start-output [CTRL][U] Kill the command line [CTRL][Y] Yank text [CTRL][C] tty-sigintr [CTRL][Z] tty-sigtsusp [CTRL][\] tty-sigquit [CTRL][]] tty-dsuspBy default, the shell is in insert mode. Therefore, any text you type will be inserted into the command line at the current cursor position. You can change the default input mode by setting the input mode environment variable to a value of overwrite.
An additional function is provided by the [CTRL] [D] key sequence. This will display a columned list of all possible words that match what is typed. If the word is a complete subdirectory name, this function will display all the files in that directory. Note that the [CTRL] [D] sequence must be issued at the end of the command line to work in this manner. If it is issued on a character, it will delete the character under the cursor.
Spelling correction can be done automatically with the use of the correct environment variable. A value of cmd will cause the shell to correct the spelling of the command when the [ENTER] key is pressed. If the value is set to all, then the shell will check the spelling of the entire command when the [ENTER] key is pressed. If any part of the command line is misspelled, the shell will display the corrected command line after the prompt specified by the prompt3 shell variable. Answering [Y] will cause the correct line to be executed, and pressing [E] will leave the uncorrected command line in the edit buffer.
If you wish to have a command executed every so often, you can have the shell do this automatically. Simply alias the periodic command to the command you want executed periodically. The shell will then execute the command every tperiod minutes. The tperiod shell variable specifies the number of minutes between executions. If this variable is set to 0 or unset, it acts as another form of the precmd alias. The beepcmd alias can be used to specify a command to execute whenever the shell attempts to beep the terminal. This is useful if you are using a terminal which can not sound an audible bell.
Sequence Brief Description Sequence Brief Description
-------------------------------------------------------------------------------
%/ Current working directory %~ cwd with ~ substitution for $HOME
%c Trailing component of cwd %C Trailing part of cwd
%! Current history event number %M The full machine host name
%m Host name up to first '.' %% A single %
%S Start standout mode %s Stop standout mode
%B Start boldfacing mode %b Stop boldfacing mode
%U Start underline mode %u Stop underline mode
%t Current time (12 hour format) %T Current time (24 hour format)
\c c is parsed as in bindkey ^c c is parsed as with bindkey
%n The value of the user variable %# A # if tcsh is run as root shell
%d The day in word format %D The day number format
%w The month in word format %W The month in number format
%y The year in two digit format %Y The year in four digit format
%l The line (tty) you are on %L Clear from prompt to end of display
%? Return code from last command %{..%} Include str as literal esc sequence
You can change the message displayed on your terminal by specifying it as the value for the who shell variable. This variable can be set in the similar manner as the prompt variable. The default string is "%n has %a %l." The table below shows some of the possible formatting sequences.
Format Brief Description Format Brief Description ------------------------------------------------------------------------------- %n The name of the user watched %a The observed action %l The line (tty) of the user %S Start standout mode %s Stop standout mode %B Start boldface mode %b Stop boldface mode %U Start underline mode %u Stop underline mode %M The full host name of remote host %m The host name up to the first '.' %t The time in 12 hour format %T The time in 24 hour format %D The day in dd format %Y The year in yy format %w The month in word format %W The month in number format
Variable Brief Description ------------------------------------------------------------------------------ HPATH Path in which to look for command documentation LANG Used to give preferred character environment LC_CTYPE Used to change ctype character handling NOREBIND Inhibits rebinding of printable characters PATH Path to look for command execution SHLVL Current shell level nesting TERM Used to tell what type of terminal is being used LINES Number of lines on the terminal COLUMNS Number of columns on the terminal TERMCAP Terminal capability string SYSTYPE The current system type
Variable Brief Description ------------------------------------------------------------------------------- addsuffix Add a / for directories and a space for files when completing words ampm Show all time in 12 hour format with AM/PM autocorrect Correct misspelled words automatically autoexpand Invoke the expand history function automatically autolist List possibilities on an ambiguous completion autologout Specifies how long the shell should wait before logging you out backslash_quote Makes the backslash quote \, ', and " correct Automatically try to correct the spelling of commands dextract Extract a directory on pushd rather than rotating dunique Push only directories that are not in the directory stack echo_style Set the style of the builtin echo edit Use the input editor fignore List of file name suffixes to ignore during a complete gid The current group id histlit If set, history will record the literal command lines histfile The file to store the history of commands inputmode Can be set to insert or overwrite listjobs List all jobs when suspending listlinks Resolve symbolic links when listing files listmax Maximum number of items to list without asking matchbeep Control beeping upon completion nobeep Disables beeping completely nokanji If kanji support is enabled, this will disable it nostat List of directories that should not be stated during a completion oid The organization id number printexitvalue If an interactive program exits non-zero, print the value prompt The prompt to use for command input prompt2 The string to prompt for while and for loops prompt3 String to prompt when automatic spelling has corrected a line pushdtohome Make pushd with no args do a pushd ~ pushdsilent Do not print the dir stack on every pushd and popd recexact Recognize exact matches even if they are ambiguous rmstar Prompt the user before executing an rm * command savedirs Before exiting, create a ~/.cshdirs file to store the directory stack savehist Number of history commands to store shlvl Integer value specifying the number of nested shells showdots Show hidden files in list and complete operations symlinks Used with symbolic links tcsh Holds the current version of the tc shell term The terminal type tperiod Periodic command wait period in minutes tty The name of the tty uid The current real user ID version The version ID stamp for this tc shell. visiblebell Use the visible bell (screen flash) rather than audible bell watch List of events to watch who Format string for the printouts generated when the watch variable is set wordchars list of non-alphanumeric characters considered part of a word
If you have a long file name, it is easier to type enough characters on the command line to distinguish it from all other files and then press the [TAB] key. This will cause the shell to complete the file name for you.
The following command will make your prompt appear similar to the prompt used by MS-DOS.
set prompt="%M:%/> "
A prompt similar to that used by the IBM 4381 running ESA can be done by using the string
"Ready(%?); %T\n" with the ampm variable unset.
(c) Copyright UCF Computer Services I& R Support 07/26/93