Section 7.10. Macros

7.10. 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.

q x

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

_ * \ =

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.




MAC OS X Tiger in a Nutshell
Mac OS X Tiger in a Nutshell: A Desktop Quick Reference (In a Nutshell (OReilly))
ISBN: 0596009437
EAN: 2147483647
Year: 2003
Pages: 130

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net