Yes. Vim documentation, section 40.2, Command-line mappings:
The Vim editor enables you to define
your own commands. You execute these
commands just like any other
Command-line mode command. To
define a command, use the ":command"
command, as follows:
:command DeleteFirst 1delete
Now when you execute the command
":DeleteFirst" Vim executes
":1delete", which deletes the first
line.
Note: User-defined commands must
start with a capital letter. You
cannot use ":X", ":Next" and
":Print". The underscore cannot be
used! You can use digits, but this
is discouraged.
Whack the line in your ~/.vimrc (minus the inital : of course) and it will be defined every time you start vim.
If you'd only like it to be defined for the one file, or for certain files, you want an autocommand.