beautypg.com

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

background image

Example 2 Sample .exrc File

" arrow keys
map k
map! ki

map j
map! ji

map l
map! li

map h
map! hi

" Insert key
map i

" Delete key
map x
map! xi

" Page Up key
map
map! i

" Page Down key
map
map! i

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

This manual is related to the following products: