DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Editing files

Saving frequently used commands

If you have a set of commands that you use frequently, place them in a file called .exrc in your home directory. Whenever vi starts up it will look for this file and execute any commands or mappings it sees in it. The mappings will be available to you in every vi session without the need to retype them each time.

You can place comments in your .exrc file to tell you what your commands do, by starting a line with a ``#''; this tells vi to ignore the line. For example, your .exrc file might look like this:

   # My .exrc file. Last changed: 20-March-1995
   #
   # Define where new lines are to be inserted automatically
   :set wrapmargin=15
   # Allow special characters in search patterns without using backslash
   :set nomagic
   # Define an abbreviation
   :ab eC European Community
   # The % key in command mode now reads in the file .address
   # at the top of the current file
   :map % ma1G^:r /u/roberta/address^M`a
   


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 22 April 2004