Create a sample edit file, Opening a file, Create a sample edit file opening a file – HP NonStop G-Series User Manual
Page 157: Sample .exrc file

Example 2 Sample .exrc File
" arrow keys
map
map!
map
map!
map
map!
map
map!
" Insert key
map
" Delete key
map
map!
" Page Up key
map
map!
" Page Down key
map
map!
The map command maps a vi command to a command key. The map! command performs the
same mapping for text input mode.
Create a Sample Edit File
Before you get started with the following examples of vi, you need to create a sample file to edit.
Create that file with the cat command as follows:
$ cat > my.file
You can use this text file
to experiment with vi.
Opening a File
The basic syntax for vi is the same whether you are creating a new file or opening an existing
file:
vi file
file
is the name of either the new file you are creating or the existing file you are opening.
To open the file my.file, enter:
$ vi my.file
Your screen should look like the following:
You can use this text file
to experiment with vi.
~
~
~
~
~
~
~
"my.file" 2 lines, 46 characters
Getting Started
157