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.

Aliases defined with ^name are saved in the preferences file and listed in a top-level Aliases menu. Choosing an entry in the Aliases menu executes the alias. Other (non-start-of-line) aliases can be set up automatically by placing alias commands in a startup command file (see the Command Line preferences). Aliases of both types are saved in sessions.

The alias command without any arguments shows the definitions of all current aliases in the Reply Log. The definition of a specific alias can be shown with alias name, and the alias can be deleted with ~alias name (^name should be used instead of name if the alias was defined that way).

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.

See also: namesel