TCC Keystroke Aliases
The second type of alias is the keystroke alias. Keystroke aliases insert characters at the command line when you press a single key. There are two kinds of keystroke aliases: the kind that automatically executes the current command line (essentially pressing Enter for you); and the kind that doesn't.
Autoexecuting keystroke aliases are generally used to run an entire command, or even a series of commands, with a single keystroke. Since the command is run as soon as you press the assigned key, you won't get a chance to edit the command or to add filenames or other options. Use this kind of alias for commands which you use very frequently, and which either don't require arguments, or which you always pass the same arguments. You should also be wary of using autoexecuting keystroke aliases for any command that might be dangerous or disruptive. Assigning DEL /Y * or REBOOT to a single keystroke might wind up costing you far more time than it saves!
To define an autoexecuting keystroke alias, give it a name of two @ signs followed by the key name:
A keystroke alias which does not automatically execute — an “insert-only”alias — is more flexible. Since you get a chance to edit the command before pressing Enter, you can use it for commands that may take arguments. To define an insert-only keystroke alias, name it with a single @ sign followed by the key name:
alias @f5=`edit `
Note that if a command may take arguments, you can include a trailing space in the definition. You can even include default arguments:
alias @f5=edit *.txt
If you press F5 after defining this alias, the command EDIT *.TXT will be inserted into the command line; you can backspace over the *.TXT to type something different, or even press Tab to complete names of .TXT files in the current directory.
Insert-only keystroke aliases are not just for commands; they can also be used to add other text to an existing command line. Frequently-used arguments, filenames, wildcard patterns, server and share names — any string that you type very often is a good candidate for a keystroke alias:
alias @alt-t= *.txt;*.doc;*.me;*.1st
alias @alt-w=` /[d-7] `
After defining a keystroke alias, you may discover that it doesn't work because TCC reserves the key for some other purpose. If you tried the examples above, you will know that the @@F12 didn't work as expected; F12 has a minor filename-completion function. If you'd rather use a key for your own alias instead of its predefined function, you can“de-assign” it by adding a NormalKey= or NormalEditKey= directive to the TCMD.INI file. NormalKey= de-assigns a general input key, and NormalEditKey= de-assigns command-line editing keys. If you don't know which group a given key belongs to, you can simply use both directives — there's no harm in having both:
Copyright © 2011, Charles Dye