Unix Power ToolsUnix Power ToolsSearch this book

18.12. Don't Lose Important Functions with vi Maps: Use noremap

For years, I assumed that I could map (Section 18.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 thought 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 (Section 17.5):

set noremap
map ^F ^G
map ^A ^F

-- JP



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.