Example Usage

Using Vim on z/OS

What is Vim?

Vim (Vi IMproved) is a versatile text editor popular among programmers for its efficient editing capabilities. While commonly found on various operating systems, Vim can also be used within the z/OS environment.

Opening and creating files with Vim

Vim allows you to create new files or edit existing ones. Use the commands provided in each section to perform respective actions.

Create a new file

vim new.txt

This command opens Vim with a new, empty file named "new.txt".

Edit an existing file:

vim $HOME/.profile

This command opens Vim for editing the existing file located at "$HOME/.profile". Upon save, vim will attempt to preserve the original file tag.

File encoding with Vim on z/OS

Vim on z/OS recognizes two file encodings.

  • IBM-1047
  • ISO8859-1 (ASCII)

When opening an untagged file or creating a new one, Vim automatically saves it using the ISO8859-1 encoding.

To modify this default behavior and set a preferred encoding for new files, utilize the _ENCODE_FILE_NEW environment variable.

Here's an example:

export _ENCODE_FILE_NEW=IBM-1047

This command sets the environment variable to instruct Vim to tag new files with the IBM-1047 encoding.

For further information on Vim functionalities and advanced usage, refer to the official Vim documentation.