Chimera Commands Index

Usage:
alias [ [^]name [ wordlist... ] ]

Usage:
~alias [^]name

Alias assigns to name the specified wordlist. Subsequent occurrences of name (space- and/or semicolon-delimited) in commands will be replaced with wordlist. Using ^name indicates that only occurrences at the beginning of a line should be replaced. This is useful for aliasing a long command to a short name without having to worry about that same name appearing (and being expanded) in the middle of some other command.

Within wordlist, $1, $2, $3 ... may be used to indicate the first, second, third ... arguments of name. To have a string with spaces in it handled as a single argument, replace each space with an underscore. Any underscores will be replaced with spaces before the command is executed. For example,

alias colorsrf color $1,s #0$2.a
alias helix5 :200-228
colorsrf light_sea_green helix5
is equivalent to
color light sea green,s #0:200-228.a
which colors the molecular surface of the specified residues light sea green.

Note that wordlist may contain multiple commands separated by semicolons, for example:

alias inspect ~color; ~rl; focus $1; color byatom $1; rl $1
inspect :26
Avoid embedding semicolons in an alias by accident. For example, the following will not color anything red because the entire line is interpreted as merely creating an alias:
alias others ligand | ions | solvent; color red others
In this case, the aliasing and coloring commands should be on separate lines.

The alias command without any arguments reports all current aliases in the Reply Log. The alias command with name only reports the alias for that name. ~alias name deletes the alias for that name.

Although aliases and color definitions are saved in sessions, placing such commands in a midasrc file is the most convenient way to apply them each time Chimera is used. A midasrc file is simply a command file that is executed automatically when the Command Line is started (see the Command Line preferences).

See also: namesel