Полезная информация

UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 31.13 Making Cursor Keys Work in vi Text-input Mode Chapter 31
Creating Custom Commands in vi
Next: 31.15 Fooling vi into Allowing Complex Macros
 

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


Previous: 31.13 Making Cursor Keys Work in vi Text-input Mode UNIX Power ToolsNext: 31.15 Fooling vi into Allowing Complex Macros
31.13 Making Cursor Keys Work in vi Text-input Mode Book Index31.15 Fooling vi into Allowing Complex Macros

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System