Creating Custom Commands in vi
Contents:
Why Type More Than You Have To?
Save Time and Typing with the vi map Commands
What You Lose When You Use map!
vi @-Functions
Keymaps for Pasting into a Window Running vi
Protecting Keys from Interpretation by ex
Maps for Repeated Edits
More Examples of Mapping Keys in vi
Good Stuff for Your .exrc File
Repeating a vi Keymap
Typing in Uppercase Without CAPS LOCK
Text-Input Mode Cursor Motion with No Arrow Keys
Making Cursor Keys Work in vi Text-input Mode
Don't Lose Important Functions with vi Maps: Use noremap
Fooling vi into Allowing Complex Macros
vi Macro for Splitting Long Lines
Why Type More Than You Have To?
Keymapping - storing complex command sequences so that they can be executed with a single keystroke - is one of my favorite timesavers. There's nothing like typing one key and watching a whole string of work take place. For repetitive edits (e.g., font changes) it's a real wrist-saver, too. Now we show you how to:
- Save time by mapping keys: articles , , , and .
- Know when to map a key and when not to: article .
- Map keys like ESC and RETURN: article .
- Move around the file without leaving text-input mode: articles and .
- Protect the text you're pasting in from another window: article .
- Put custom commands in your exrc file: articles , , and .
- Break long lines of text: article .
- EK