O'Reilly logo

Mac OS X Tiger in a Nutshell by Jason McIntosh, Chuck Toporek, Chris Stone, Andy Lester

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Macros

Command

Action

:ab in out

Use in as abbreviation for out.

:unab in

Remove abbreviation for in.

:ab

List abbreviations.

:map c sequence

Map character c as sequence of commands.

:unmap c

Disable map for character c.

:map

List characters that are mapped.

:map! c sequence

Map character c to input mode sequence.

:unmap! c

Disable input mode map (you may need to quote the character with Ctrl-V).

:map!

List characters that are mapped to input mode.

qx

Record typed characters into register specified by letter x. If letter is uppercase, append to register. (vim)

q

Stop recording. (vim)

@x

Execute the register specified by letter x. (vim)

In vi, the following characters are unused in command mode and can be mapped as user-defined commands:

Letters

g K q V v

Control keys

^K ^O ^T ^W ^X

Symbols

_ * \ =

Tip

The = is used by vi if LISP mode is set. vim uses all of these characters, but you can create macros for function keys and multiple character commands. See :help :map for details. Other versions of vi may use some of these characters as well, so test them before using them.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required