[Chapter 31] 31.14 Don't Lose Important Functions with vi Maps: Use noremap
Author: Jerry Peek, Tim O'Reilly & Mike Loukides
Date: 1998-08-04T21:46:27Z

#

| Chapter 31 Creating Custom Commands in vi |

## 31.14 Don't Lose Important Functions with vi Maps: Use noremap

For years, I assumed that I could map (31.2) only a few keys in vi-the characters like v and A that aren't used. For instance, if I mapped F to do something else, I thought I'd lose that handy "forward one screen" command. You think the same thing? Then we're both wrong!

Just use the noremap option. Here's a simple example. You can make F the "show file information" (normally G ) command. Then, make A take over the "forward (ahead) one screen" function. Put these lines in your .exrc file (30.6):

>     set noremap
>     map F G
>     map A F

- JP

31.13 Making Cursor Keys Work in vi Text-input Mode |  | 31.15 Fooling vi into Allowing Complex Macros