Vim documentation: os_vms

main help file

*os_vms.txt*    For Vim version 6.3.  Last change: 2004 May 16


							*VMS* *vms*
This file contains the particularities for the VMS version of Vim.
You can reach this information file by typing :help VMS in Vim command

 1. Getting started	|vms-started|
 2. Download files	|vms-download|
 3. Compiling		|vms-compiling|
 4. Problems		|vms-problems|
 5. Deploy		|vms-deploy|
 6. Practical usage	|vms-usage|
 7. GUI mode questions	|vms-gui|
 8. Useful notes	|vms-notes|
 9. VMS related changes	|vms-changes|
10. Authors		|vms-authors|


1. Getting started					*vms-started*

Vim (Vi IMproved) is a vi-compatible text editor that runs on nearly every
operating system known to humanity.  Now use Vim on OpenVMS too, in character
or X/Motif environment.  It is fully featured and absolutely compatible with
Vim on other operating systems.


2. Download files					*vms-download*

You can download the Vim source code by ftp from the official Vim site:
Or use one of the mirrors:

You will need both the Unix and Extra archives to build vim.exe for VMS.
For using Vim's full power you will need the runtime files as well.

You can download precompiled executables from:

To use the precompiled binary version, you need one of these archives:      Alpha GUI/Motif executables      Alpha GUI/GTK executables     Alpha console executables	VAX GUI executables       VAX console executables

and of course		runtime files

The binary archives contain: vim.exe, ctags.exe, xxd.exe, mms_vim.exe files.


3. Compiling						*vms-compiling*

See the file [.SRC]INSTALLVMS.TXT.


4. Problems						*vms-problems*

The code has been tested under Open VMS 6.2 - 7.3 on Alpha and VAX platforms
with the DECC compiler. It should work without bigger problems.
If it happened that your system does not have some include libraries you can
tune up in OS_VMS_CONF.H file.

If you decided to build Vim with +perl, +python, etc. options, first you need
to download OpenVMS distributions of Perl and Python. Build and deploy the
libraries and change adequate lines in MAKE_VMS.MMS file. There should not be
problem from Vim side.

Note: Under VAX it should work with DEC C compiler without problem. VAXC
compiler is not fully ANSI C compatible in pre-processor directives
semantics, therefore you have to use a converter program what will do the
lion part of the job. For detailed instruction read file INSTALLvms.txt

MMS_VIM.EXE is building together with VIM.EXE, but for XD.EXE you should
change to subdirectory and build it separately.

CTAGS is not part of Vim source distribution any more, however the OpenVMS
specific source might contain CTAGS source files as it is described above.
You can find more information about CTAGS on VMS at

Advanced users may try some acrobatics in FEATURE.H file also.

It is possible to compile with +xfontset +xim options too, but then you have
to set up GUI fonts etc. correctly. See. :help xim from Vim command prompt.

You may want to use GUI with GTK icons, then you have to download and install
GTK for OpenVMS or at least runtime shareable images - LIBGTK from

For more advanced questions, please send your problem to Vim on VMS mailing
list <[email protected]> 
More about the vim-vms list can be found at:


5. Deploy						*vms-deploy*

Vim uses a special directory structure to hold the document and runtime files:

   vim (or wherever)
    |- tmp
    |- vim57
    |----- doc
    |----- syntax
    |- vim60
    |----- doc
    |----- syntax
    |- vim61
    |----- doc
    |----- syntax
    vimrc    (system rc files)


	define/nolog VIM	device:[path.vim]
	define/nolog VIMRUNTIME device:[path.vim.vim60]
	define/nolog TMP	device:[path.tmp]

to get vim.exe to find its document, filetype, and syntax files, and to
specify a directory where temporary files will be located. Copy the "runtime"
subdirectory of the vim distribution to vimruntime.

Logicals $VIMRUNTIME and $TMP are optional.

If $VIMRUNTIME is not set, Vim will guess and try to set up automatically.
Read more about at :help runtime

If $TMP is not set, you will not be able to use some functions as CTAGS,
XXD, printing etc. that use temporary directory for normal operation.
$TMP directory should be readable and writable by the user(s).
The easiest way to set up $TMP is to define logical:

	define/nolog TMP SYS$SCRATCH
or as:
	define/nolog TMP SYS$LOGIN


6. Practical usage					*vms-usage*

Usually, you want to run just one version of Vim on your system, therefore
it is enough to dedicate one directory for Vim.
Copy all Vim runtime directory structure to the deployment position.
Add the following lines to your LOGIN.COM (in SYS$LOGIN directory).
Set up logical $VIM as:

	$ define VIM device:<path>

Set up some symbols:

	$ ! vi starts Vim in chr. mode.
	$ vi*m  :== mcr VIM:VIM.EXE

	$ !gvi starts Vim in GUI mode.
	$ gv*im :== spawn/nowait mcr VIM:VIM.EXE -g

Please, check the notes for customization and configuration of symbols.

You may want to create .vimrc and .gvimrc files in your home directory
(SYS$LOGIN) to overwrite default settings.

The easiest way is just rename example files. You may leave the menu file
(MENU.VIM) and files vimrc and gvimrc in the original $VIM directory. It will
be default setup for all users, and for users is enough just to have their
own additions or resetting in home directory in files .vimrc and .gvimrc.
It should work without problems.

Note: Remember, system rc files (default for all users) does not have leading
"." So, system rc files are:


and user's customized rc files are:


You can check that everything is on the right place with the :version command.

Example LOGIN.COM:

	$ define/nolog VIM RF10:[UTIL.VIM]
	$ vi*m :== mcr VIM:VIM.EXE
	$ gv*im:== spawn/nowait/input=NLA0 mcr VIM:VIM.EXE -g -GEOMETRY 80x40
	$ set disp/create/node=

Note: This set-up should be enough, if you are working on standalone server or
clustered environment, but if you want to use Vim as internode editor in
DECNET environment, it will satisfy you as well.
You just have to define the "whole" path:

	$ define VIM "<server_name>[""user password""]::device:<path>"
	$ vi*m :== "mcr VIM:VIM.EXE"

as for example:

	$ define VIM "PLUTO::RF10:[UTIL.VIM]"
	$ define VIM "PLUTO""ZAY mypass""::RF10:[UTIL.VIM]" ! if passwd required

You can also use $VIMRUNTIME logical to point to proper version of Vim if you
have installed more versions in the same time. If $VIMRUNTIME is not defined
Vim will borrow value from $VIM logical. You can find more information about
$VIMRUNTIME logical by typing :help runtime as a Vim command.

System administrators might want to set up a system wide Vim installation,

	$ define/nolog/sys VIM device:<path>
	$ define/nolog/sys TMP SYS$SCRATCH


	$ vi*m :== mcr VIM:VIM.EXE
	$ gv*im:== spawn/nowait/input=NLA0 mcr VIM:VIM.EXE -g -GEOMETRY 80x40

It will set up normal Vim work environment for every user on the system.


7. GUI mode questions					*vms-gui*

OpenVMS in a real mainframe OS, therefore even if it has a GUI console, most of
the users does not use a native X/Window environment during normal operation.
It is not possible to start Vim in GUI mode "just like that". But anyhow it is
not too complicate either.

First of all: you will need an executable that is built with enabled GUI.

Second: you need to have installed DECW/Motif on your VMS server, otherwise
you will get errors that some shareable libraries are missing.

Third: If you choose to run Vim with extra feature as GUI/GTK then you need
GTK installation too or at least GTK runtime environment (LIBGTK etc.)

1) If you are working on the VMS X/Motif console:
   Start Vim with the command:

	$ mc device:<path>VIM.EXE -g
   or type :gui as a command to the Vim command prompt. For more info :help gui

2) If you are working on other X/Window environment as Unix or some remote X
   VMS console. Set up display to your host with:

	$ set disp/create/node=<your IP address>/trans=<transport-name>
   and start Vim as in point 1. You can find more help in VMS documentation or
   type: help set disp in VMS prompt.

	$ set disp/create/node=		 ! default trans is DECnet
	$ set disp/create/node= ! TCP/IP network
	$ set disp/create/node= ! display on the same node

Note: you should define just one of these.
For more information type $help set disp in VMS prompt.

3) Another elegant solution is XDM if you have installed on OpenVMS box.
   It is possible to work from XDM client as from GUI console.

4) If you are working on MS Windows or other non X/Window environment
   You need to set up one X server and run Vim as in point 2.
   For MS Windows there are available free X servers as MIX , Omni X etc.
   as well as excellent commercial products as eXcursion or ReflectionX with
   buit in DEC support.

Please note, that executables without GUI are slightly faster during startup
then with enabled GUI in character mode. Therefore, if you do not use GUI
features, it is worth to choose non GUI executables.


8. Useful notes						*vms-notes*

8.1 backspace/delete
8.2 Filters
8.3 VMS file version numbers
8.4 Directory conversion
8.5 Remote host invocation
8.6 Terminal problems
8.7 Hex-editing and other external tools
8.8 Sourcing vimrc and gvimrc
8.9 Printing from Vim
8.10 Setting up the symbols
8.11 diff and other GNU programs
8.12 diff-mode
8.13 Allow '$' in C keywords
8.14 VIMTUTOR for beginners

8.1 backspace/delete

There are backspace/delete key inconsistencies with VMS.
:fixdel doesn't do the trick, but the solution is:

	:inoremap ^? ^H		" for terminal mode
	:inoremap <Del> ^H	" for gui mode

Read more in ch: 8.6 (Terminal problems).
(Bruce Hunsaker <[email protected]> Vim 5.3) 

8.2 Filters

Vim supports filters; ie. if you have a sort program that can handle
input/output redirection like Unix (<infile >outfile), you could use

	:map \s 0!'aqsort<CR>

(Charles E. Campbell, Jr. <[email protected]> Vim 5.4) 

8.3 VMS file version numbers

Vim is saving files into a new file with the next higher file version
number, try these settings.

	:set nobackup	     " does not create *.*_ backup files
	:set nowritebackup   " does not have any purpose on VMS. It's default.

Recovery is working perfect as well from the default swap file.
Read more with :help swapfile

(Claude Marinier <[email protected]> Vim 5.5, Zoltan Arpadffy 
Vim 5.6 )

8.4 Directory conversion

Vim will internally convert any unix-style paths and even mixed unix/VMS
paths into VMS style paths. Some typical conversions resemble:

	/abc/def/ghi		-> abc:[def]ghi.
	/abc/def/ghi.j		-> abc:[def]ghi.j
	/abc/def/ghi.j;2	-> abc:[def]ghi.j;2
	/abc/def/ghi/jkl/mno	-> abc:[def.ghi.jkl]mno.
	abc:[def.ghi]jkl/mno	-> abc:[def.ghi.jkl]mno.
	  ./			-> current directory
	  ../			-> relative parent directory
	  [.def.ghi]		-> relative child directory
	   ./def/ghi		-> relative child directory

Note: You may use <,> brackets as well (device:<path>file.ext;version) as

(David Elins <[email protected]>, Jerome Lauret 
<[email protected]> Vim 5.6 ) 

8.5 Remote host invocation

It is possible to use Vim as an internode editor.
1. Edit some file from remote node:

	vi "<server>""username passwd""::<device>:<path><filename>;<version>"

	vi "pluto""zay passwd""::RF10:<USER.ZAY.WORK>TEST.C;1"

Note: syntax is very important, otherwise VMS will recognize more parameters
instead of one (resulting with: file not found)

2.  Set up Vim as your internode editor. If Vim is not installed on your host,
just set up your IP address, full Vim path including the server name and run
the command procedure below:

	$ if (p1 .eqs. "") .OR. (p2 .eqs. "") then goto usage
	$ set disp/create/node=<your_IP_here>/trans=tcpip
	$ define "VIM "<vim_server>""''p1' ''p2'""::<device>:<vim_path>"
	$  vi*m :== "mcr VIM:VIM.EXE"
	$ gv*im :== "spawn/nowait mcr VIM:VIM.EXE -g"
	$ goto end
	$ usage:
	$ write sys$output " Please enter username and password as a parameter."
	$ write sys$output " Example: @SETVIM.COM username passwd"
	$ end:

Note: Never use it in clustered environment (you do not need it), and load could
be very-very slow, but even faster then a local Emacs. :-)

(Zoltan Arpadffy, Vim 5.6)

8.6 Terminal problems

If your terminal name is not known to Vim and it is trying to find the default
one you will get the following message during start-up:
Terminal entry not found in termcap
'unknown-terminal' not known. Available built-in terminals are:
defaulting to 'vt320'
The solution is to define default terminal name:

	$ ! unknown terminal name. let us use vt320 or ansi instead.
	$ ! Note: it's case sensitive
	$ define term "vt320"

Terminals from VT100 to VT320 (as V300, VT220, VT200 ) do not need any extra
keyboard mappings. They should work perfect as they are, including arrows,
Ins, Del buttons etc. Except Backspace in GUI mode. To solve it, add to

	inoremap <Del> <BS>

Vim will also recognize that they are fast terminals.

If you have some annoying line jumping on the screen between windows add to
your .vimrc file:

	set ttyfast	" set fast terminal

Note: if you're using Vim on remote host or through very slow connection, it's
recommended to avoid fast terminal option with:

	set nottyfast   " set terminal to slow mode

(Zoltan Arpadffy, Vim 5.6)

8.7 Hex-editing and other external tools

A very important difference between OpenVMS and other systems is that VMS uses
special commands to execute executables:

	RUN <path>filename
	MCR <path>filename <parameters>

OpenVMS users always have to be aware that the Vim command :! "just" drop them
to DCL prompt. This feature is possible to use without any problem with all
DCL commands, but if we want to execute some program as XXD, CTAGS, JTAGS etc.
we're running into trouble if we following the Vim documentation (see: help

Solution: Execute with the MC command and add the full path to the executable.
Example: Instead of :%!xxd command use:

	:%!mc vim:xxd

... or in general:
	:!mc <path>filename <parameters>

Note: You can use XXD, and CTAGS from GUI menu.

To customize ctags it is possible to define logical $CTAGS with standard
parameters as:

	define/nolog CTAGS "--totals -o sys$login:tags"

For additional information, please read :help tagsearch and CTAGS
 documentation at

(Zoltan Arpadffy, Vim 5.6-70)

8.8 Sourcing vimrc and gvimrc

If you want to use your .vimrc and .gvimrc from other platforms (e.g. Windows)
you can get in trouble if you ftp that file(s): VMS has different end-of-line
The symptom is that ViM is not sourcing your .vimrc/.gvimrc, even if you say:

	:so sys$login:.vimrc

One trick is to compress (e.g. zip) the files on the other platform and
uncompress it on VMS; if you have the same symptom, try to create the files
with copy-paste (for this you need both op. systems reachable from one
machine, e.g. an Xterm on Windows or telnet to Windows from VMS).

(Sandor Kopanyi, <[email protected]> Vim 6.0a) 

8.9 Printing from Vim

To be able to print from Vim (running in GUI mode) under VMS you have to set
up $TMP logical which should point to some temporary directory and logical
SYS$PRINT to your default print queue.


You can print out whole buffer or just the marked area.
More info under :help hardcopy

(Zoltan Arpadffy, Vim 6.0c)

8.10 Setting up the symbols

When I use GVIM this way and press CTRL-Y in the parent terminal, gvim exits.
I now use a different symbol that seems to work OK and fixes the problem.
I suggest this instead:


The /INPUT=NLA0: separates the standard input of the gvim process from the
parent terminal, to block signals from the parent window.
Without the -GEOMETRY, the GVIM window size will be minimal and the menu
will be confused after a window-resize.

(Carlo Mekenkamp, Coen Engelbarts, Vim 6.0ac)

8.11 diff and other GNU programs

From 6.0 diff functionality has been implemented, but OpenVMS does not use
GNU/Unix like diff therefore built in diff does not work.
There is a simple solution to solve this anomaly. Install an Unix like diff
and Vim will work perfect in diff mode too. You just have to redefine your
diff program as:

	define /nolog diff <GNU_PATH>diff.exe

Another, more sophisticated solution is described below (8.12 diff-mode)
There are some other programs as patch, make etc that may cause same problems.
At is possible to download an GNU package for Alpha and VAX
boxes that is meant to solve GNU problems on OpenVMS.
( Zoltan Arpadffy, Vim 6.1)

8.12 diff-mode

Vim 6.0 and higher supports vim diff-mode (See |new-diff-mode|, |diff-mode|
and |08.7|). This uses the external program 'diff' and expects a Unix-like
output format from diff. The standard VMS diff has a different output
format. To use vim on VMS in diff-mode, you need to:
    1 Install a Unix-like diff program, e.g. GNU diff
    2 Tell vim to use the Unix-like diff for diff-mode.

You can download GNU diff from the VIM-VMS website, it is one of the GNU
 tools in I suggest to
unpack it in a separate directory "GNU" and create a logical GNU: that
points to that directory. e.g:


You may also want to define a symbol GDIFF, to use the GNU diff from the DCL

   GDIFF :==     $GNU:DIFF.EXE

Now you need to tell vim to use the new diff program. Take the example
settings from |diff-diffexpr| and change the call to the external diff
program to the new diff on VMS. Add this to your .vimrc file:

     " Set up vimdiff options
       if v:version >= 600
	" Use GNU diff on VMS
	set diffexpr=MyDiff()
	function MyDiff()
	   let opt = ""
	   if &diffopt =~ "icase"
	     let opt = opt . "-i "
	   if &diffopt =~ "iwhite"
	     let opt = opt . "-b "
	   silent execute "!mc GNU:diff.exe -a " . opt . v:fname_in . " " .  v:fname_new .
		\  " > " . v:fname_out

You can now use vim in diff-mode, e.g. to compare two files in read-only

    $ VIM -D/R <FILE1> <FILE2>

You can also define new symbols for vimdiff, e.g.:

    $ VIMDIFF     :== 'VIM' -D/R
    $ GVIMDIFF    :== 'GVIM' -D/R

You can now compare files in 4 ways:

    1. VMS  diff:  $ DIFF     <FILE1> <FILE2>
    2. GNU  diff:  $ GDIFF    <FILE1> <FILE2>
    3. VIM  diff:  $ VIMDIFF  <FILE1> <FILE2>
    4. GVIM diff:  $ GVIMDIFF <FILE1> <FILE2>

( Coen Engelbarts, Vim 6.1)

8.13 Allow '$' in C keywords

DEC C uses many identifiers with '$' in them. This is not allowed in ANSI C,
and vim recognises the '$' as the end of the identifier. You can change this
with the YXXYiskeyword|command.
Add this command to your .vimrc file:

    autocmd FileType c,cpp,cs  set iskeyword+=$

You can also create the file(s) $VIM/FTPLUGIN/C.VIM (and/or CPP.VIM and
CS.VIM) and add this command:

	set iskeyword+=$

Now word-based commands, e.g. the '*'-search-command and the CTRL-]
tag-lookup, work on the whole identifier. (Ctags on VMS also supports '$' in
C keywords since ctags version 5.1.)

( Coen Engelbarts, Vim 6.1)

8.14 VIMTUTOR for beginners

It exits VIMTUTOR.COM DCL script that can help Vim beginners to learn/make
first steps with Vim on OpenVMS. Depending of binary distribution you may start
it with:


(Thomas.R.Wyant III, Vim 6.1)


9. VMS related changes					*vms-changes*

Version 6.3 (2004 May 10)
- Improved vms_read function
- CTAGS v5.5.4 included
- Documentation corrected and updated

Version 6.2 (2003 May 7)
- Corrected VMS system call results
- Low level character input is rewritten
- Correction in tag and quickfix handling
- First GTK build
- Make file changes
    - GTK feature added
    - Define for OLD_VMS
    - OpenVMS version 6.2 or older
- Documentation updated with GTK features
- CTAGS v5.5 included
- VMS VIM tutor created

Version 6.1 (2002 Mar 25)
- TCL init_tcl() problem fixed
- CTAGS v5.4 included
- GNU tools binaries for OpenVMS
- Make file changes
    - PERL, PYTHON and TCL support improved
    - InstallVMS.txt has a detailed description HOWTO build
- VMS/Unix file handling rewritten
- Minor casting and bug fixes

Version 6.0 (2001 Sep 28)
- Unix and VMS code has been merged
	- separated "really" VMS related code
	- included all possible Unix functionality
	- simplified or deleted the configuration files
	- makefile MAKE_VMS.MMS reviewed
- menu changes (fixed printing, CTAGS and XXD usage)
- fixed variable RMS record format handling anomaly
- corrected syntax, ftplugin etc files load
- changed expand_wildcards and expandpath functions to work more general
- created OS_VMS_FILTER.COM - DECC->VAXC pre-processor directive convert
- Improved code's VAXC and new DECC compilers compatibility
- changed quickfix parameters:
	- errormessage format to suite DECC
	- search, make and other commands to suite VMS system
- updated and renamed MMS make files for Vim and CTAGS.
- CTAGS has been removed from source distribution of Vim but it will remain
  in OpenVMS binary distributions.
- simplified build/configuration procedure
- created INSTALLvms.txt - detailed compiling instructions under VMS.
- updated test scripts.

Version 5.8 (2001 Jun 1)
- OS_VMS.TXT updated with new features.
- other minor fixes.
- documentation updated
- this version had been tested much more than any other OpenVMS version

Version 5.7 (2000 Jun 24)
- New CTAGS v5.0 in distribution
- Documentation updated

Version 5.6 (2000 Jan 17)
- VMS filename related changes:
	- version handling (open everything, save to new version)
	- correct file extension matching for syntax (version problem)
	- handle <,> characters and passwords in directory definition
	- handle internode/remote invocation and editing with passwords
	- OpenVMS files will be treated case insensitive from now
	- corrected response of expand("%:.") etc path related functions
	(in one word: VMS directory handling internally)
- version command
	- corrected (+,-) information data
	- added compiler and OS version
	- added user and host information
	- resolving $VIM and $VIMRUNTIME logicals
- VMS port is in MAX_FEAT (maximum features) club with Unix, Win32 and OS/2.
	- enabled farsi, rightleft etc. features
	- undo level raised up to 1000
- Updated OS_VMS.MMS file.
	- maximum features ON is default
	- Vim is compilable with +perl, +python and +tcl features.
	- improved MMK compatibility
- Created MAKEFILE_VMS.MMS, makefile for testing Vim during development.
- Defined DEC terminal VT320
	- compatibility for VT3*0, VT2*0 and VT1*0 - ANSI terminals
	  backwards, but not VT340 and newer with colour capability.
	- VT320 is default terminal for OpenVMS
	- these new terminals are also fast ttys (default for OpenVMS).
	- allowed dec_mouse ttym
- Updated files vimrc and gvimrc with VMS specific suggestions.
- OS_VMS.TXT updated with new features.

Version 5.5 (1999 Dec 3)
- Popup menu line crash corrected.
- Handle full file names with version numbers.
- Directory handling (CD command etc.)
- Corrected file name conversion VMS to Unix and v.v.
- Correct response of expand wildcards
- Recovery is working from this version under VMS as well.
- Improved terminal and signal handing.
- Improved OS_VMS.TXT

Version 5.4 (1999 Sep 9)
- Cut and paste mismatch corrected.
- Motif directories during open and save are corrected.

Version 5.3 (1998 Oct 12)
- Minor changes in the code
- Standard distribution with +GUI option

Version 5.1 (1998 Apr 21)
- Syntax and DEC C changes in the code
- Fixing problems with the /doc subdirectory
- Improve OS_VMS.MMS

Version 4.5 (1996 Dec 16)
- First VMS port by Henk Elbers <[email protected]> 


10. Authors						*vms-authors*

OpenVMS documentation and executables are maintained by:
Zoltan Arpadffy <[email protected]> 

This document uses parts and remarks from earlier authors and contributors
	Charles E. Campbell, Jr. <[email protected]> 
	Bruce Hunsaker <[email protected]> 
	Sandor Kopanyi <[email protected]> 

top - main help file