1*os_msdos.txt*  For Vim version 7.3.  Last change: 2005 Mar 29
2
3
4		  VIM REFERENCE MANUAL    by Bram Moolenaar
5
6
7					*msdos* *ms-dos* *MSDOS* *MS-DOS*
8This file contains the particularities for the MS-DOS version of Vim.
9
101. Two versions for MS-DOS	|msdos-versions|
112. Known problems		|msdos-problems|
123. Long file names		|msdos-longfname|
134. Termcap codes		|msdos-termcap|
145. Shifted arrow keys		|msdos-arrows|
156. Filename extensions		|msdos-fname-extensions|
167. Memory usage and limitations	|msdos-limitations|
178. Symbolically linked files	|msdos-linked-files|
189. Copy/paste in a dos box	|msdos-copy-paste|
19
20Additionally, there are a number of common Win32 and DOS items:
21File locations			|dos-locations|
22Using backslashes		|dos-backslash|
23Standard mappings		|dos-standard-mappings|
24Screen output and colors	|dos-colors|
25File formats			|dos-file-formats|
26:cd command			|dos-:cd|
27Interrupting			|dos-CTRL-Break|
28Temp files			|dos-temp-files|
29Shell option default		|dos-shell|
30
31For compiling Vim see src/INSTALL.pc.			*msdos-compiling*
32
33==============================================================================
341. Two versions for MS-DOS				*msdos-versions*
35
36There are two versions of Vim that can be used with MS-DOS machines:
37
38							*dos16*
39Dos16 version	Can be used on any MS-DOS system, only uses up to 640 Kbyte of
40		memory.  Also runs on OS/2, Windows 95, and NT.  Excludes some
41		Vim-specific features (autocommands, syntax highlighting,
42		etc.).  Recommended for use on pre-386 machines.
43							*dos32*
44Dos32 version	Requires 386 processor and a |DPMI| driver, uses all
45		available memory.  Supports long file names and the Windows
46		clipboard, but NOT on Windows NT.  Recommended for MS-DOS,
47		Windows 3.1 and Windows 95.
48
49There are also two versions that run under Windows:
50Win32 version   Requires Windows 95 or Windows NT, uses all available
51		memory, supports long file names, etc.  Has some problems on
52		Windows 95.  Recommended for Windows NT.  See |os_win32.txt|
53Win32 GUI	Requirements like the Win32 version, but runs in its own
54		window, instead of a console.  Has scrollbars, menu, etc.
55		Recommended for Windows 95 and Windows NT.  See |gui-w32|.
56
57It is recommended to use the Dos32 or Win32 version.  Although the Dos16
58version is able to edit very big files, it quickly runs out of memory when
59making big changes.  Disabling undo helps: ":set ul=-1".  The screen updating
60of the Dos16 version is the fastest of the three on DOS or Windows 95; on
61Windows NT, the Win32 version is just as fast.
62
63								*DPMI*
64For the Dos32 version, you may need a DPMI driver when running in MS-DOS.  If
65you are running Windows or installed a clever memory manager, it will probably
66work already.  If you get the message "No DPMI", you need to install a DPMI
67driver.  Such a driver is included with the executable in CSDPMI4B.ZIP.  Run
68"cwsdpmi" just before starting Vim each time.  Or you might want to include
69"cwsdpmi -p" in your autoexec.bat to make it resident.  The latest version of
70"CSDPMI*.ZIP" can be obtained from: "ftp.neosoft.com:pub/users/s/sandmann".
71
72							*minimal-features*
73The 16 bit DOS version has been compiled with minimal features.  Check the
74|+feature-list| which ones are included (marked with a "T").
75You can include more features by editing feature.h and recompiling.
76
77==============================================================================
782. Known problems					*msdos-problems*
79
80When using smartdrive (MS-DOS 6.x) with write-behind caching, it is possible
81that Vim will try to create a swap file on a read-only file system (e.g.
82write protected floppy).  You will then be given the message >
83	A serious disk error has occurred .., Retry (r)?
84There is nothing you can do but unprotect the floppy or switch off the
85computer.  Even CTRL-ALT-DEL will not get you out of this.  This is really a
86problem of smartdrive, not Vim.  Smartdrive works fine otherwise.  If this
87bothers you, don't use the write-behind caching.
88
89Vim can't read swap files that have been opened already, unless the "share"
90command has been used.  If you see stray warnings for existing swap files,
91include the "share" command in your config.sys or autoexec.bat (see your MSDOS
92documentation).
93
94The Dos16 version can only have about 10 files open (in a window or hidden) at
95one time.  With more files you will get error messages when trying to read or
96write a file, and for filter commands.  Or Vim runs out of memory, and random
97problems may result.
98
99The Dos32 version cannot have an unlimited number of files open at any one
100time.  The limit depends on the setting of FILES in your CONFIG.SYS.  This
101defaults to 15; if you need to edit a lot of files, you should increase this.
102If you do not set FILES high enough, you can get strange errors, and shell
103commands may cause a crash!
104
105The Dos32 version can work with long file names.  When doing file name
106completion, matches for the short file name will also be found.  But this will
107result in the corresponding long file name.  For example, if you have the long
108file name "this_is_a_test" with the short file name "this_i~1", the command
109":e *1" will start editing "this_is_a_test".
110
111When using the Dos32 version and you run into problems with DPMI support,
112check if there is a program in your config.sys that eats resources.  One
113program known to cause this problem is "netx", which says "NetWare v. 3.26
114Workstation shell".  Replace it with version 3.32 to fix the problem.
115
116The Dos32 version will parse its arguments to handle quotation.  This is good
117to edit a file with spaces in its name, for example: >
118	vim "program files\accessories\ppp.scp"
119A side effect is that single quotes are removed.  Insert a backslash to avoid
120that.  For example, to edit the file "fi'le.txt": >
121	vim fi\'le.txt
122
123==============================================================================
1243. Long file names					*msdos-longfname*
125
126If the Dos32 version is run on Windows 95, it can use long file names.  It
127will work by default.  If you want to disable this, use this setting:
128	set LFN=N
129You can put this in your autoexec.bat file.
130
131Note: If you have installed DJGPP on your machine, you probably have a
132"djgpp.env" file, which contains "LFN=n".  You need to use "LFN=Y" to switch
133on using long file names then.
134
135==============================================================================
1364. Termcap codes					*msdos-termcap*
137
138If you want to use another output method (e.g., when using a terminal on a COM
139port), set the terminal name to "pcansi".  You can change the termcap options
140when needed (see |terminal-options|).  Note that the
141normal IBM ansi.sys does not support all the codes of the builtin pcansi
142terminal.  If you use ansi.sys, you will need to delete the termcap entries
143t_al and t_dl with >
144   :set t_al= t_dl=
145Otherwise, the screen will not be updated correctly.  It is better to use
146nansi.sys, nnansi.sys, or the like instead of ansi.sys.
147
148If you want to use Vim on a terminal connected to a COM: port, reset the
149'bioskey' option.  Otherwise the commands will be read from the PC keyboard.
150CTRL-C and CTRL-P may not work correctly with 'bioskey' reset.
151
152==============================================================================
1535. Shifted arrow keys					*msdos-arrows*
154
155Use CTRL-arrow-left and CTRL-arrow-right instead of SHIFT-arrow-left and
156SHIFT-arrow-right.  The arrow-up and arrow-down cannot be used with SHIFT or
157CTRL.
158
159==============================================================================
1606. Filename extensions				*msdos-fname-extensions*
161
162MS-DOS allows for only one file name extension.  Therefore, when appending an
163extension, the '.' in the original file name is replaced with a '_', the name
164is truncated to 8 characters, and the new extension (e.g., ".swp") is
165appended.  Two examples: "test.c" becomes "test_c.bak", "thisisat.est"
166becomes "thisisat.bak".  To reduce these problems, the default for
167'backupext' is "~" instead of ".bak".  The backup file for "thisisat.est"
168then becomes "thisisat.es~".  The 'shortname' option is not available,
169because it would always be set.
170
171==============================================================================
1727. Memory usage and limitations			*msdos-limitations*
173
174A swap file is used to store most of the text.  You should be able to edit
175very large files.  However, memory is used for undo and other things.  If you
176delete a lot of text, you can still run out of memory in the Dos16 version.
177
178If Vim gives an "Out of memory" warning, you should stop editing.  The result
179of further editing actions is unpredictable.  Setting 'undolevels' to 0 saves
180some memory.  Running the maze macros on a big maze is guaranteed to run out
181of memory, because each change is remembered for undo.  In this case set
182'undolevels' to a negative number.  This will switch off undo completely.
183
184						*msdos-clipboard-limits*
185In the Dos32 version, extended memory is used to avoid these problems.
186However, if you are using the clipboard, you can still run into memory
187limitations because the Windows clipboard can only communicate with Vim using
188Dos memory.  This means that the largest amount of text that can be sent to
189or received from the Windows clipboard is limited by how much free Dos memory
190is available on your system.
191
192You can usually maximize the amount of available Dos memory by adding the
193following lines to Dos's "config.sys" file: >
194
195	DOS=HIGH,UMB
196	DEVICE=C:\WINDOWS\himem.sys
197	DEVICE=C:\WINDOWS\emm386.exe RAM
198
199Modifying config.sys in this way will also help to make more memory available
200for the Dos16 version, if you are using that.
201
202In the Dos16 version the line length is limited to about 32000 characters.
203When reading a file the lines are automatically split.  But editing a line
204in such a way that it becomes too long may give unexpected results.
205
206==============================================================================
2078. Symbolically linked files			*msdos-linked-files*
208
209When using Vim to edit a symbolically linked file on a unix NFS file server,
210you may run into problems.  When writing the file, Vim does not "write
211through" the symlink.  Instead, it deletes the symbolic link and creates a new
212file in its place.
213
214On Unix, Vim is prepared for links (symbolic or hard).  A backup copy of the
215original file is made and then the original file is overwritten.  This assures
216that all properties of the file remain the same.  On non-Unix systems, the
217original file is renamed and a new file is written.  Only the protection bits
218are set like the original file.  However, this doesn't work properly when
219working on an NFS-mounted file system where links and other things exist.  The
220only way to fix this in the current version is not making a backup file, by
221":set nobackup nowritebackup"	|'writebackup'|
222
223A similar problem occurs when mounting a Unix filesystem through Samba or a
224similar system.  When Vim creates a new file it will get the default user ID
225for the mounted file system.  This may be different from the original user ID.
226To avoid this set the 'backupcopy' option to "yes".
227
228==============================================================================
2299. Copy/paste in a dos box			*msdos-copy-paste*
230
231					*E450* *E451* *E452* *E453* *E454*
232The 32 bit version can copy/paste from/to the Windows clipboard directly.  Use
233the "* register.  Large amounts of text can be copied this way, but it must be
234possible to allocate memory for it, see |msdos-clipboard-limits|.  When moving
235text from one Vim to another, the type of the selection
236(characterwise/linewise/blockwise) is passed on.
237
238In other versions, the following can be used.
239
240(posted to comp.editors by John Velman <velman@igate1.hac.com>)
241
242How to copy/paste text from/to vim in a dos box:
243
2441) To get VIM to run in a window, instead of full screen, press alt+enter.
245   This toggles back and forth between full screen and a dos window.
246   NOTE: In Windows 95 you must have the property "Fast Pasting" unchecked!
247   In the properties dialog box for the MS-DOS window, go to "MS-DOS
248   Prompt/Misc/Fast pasting" and make sure that it is NOT checked.
249   To make this permanent, change the properties for
250   "\windows\system\conagent.exe" (from Philip Nelson, unverified).
251
2522) To paste something _into_ Vim, put Vim in insert mode.
253
2543) Put the text you want to paste on the windows clipboard.
255
2564) Click the control box in the upper left of the Vim window.  (This looks
257   like a big minus sign.)  If you don't want to use the mouse, you can get
258   this with alt+spacebar.
2595) On the resulting dropdown menu choose "Edit".
2606) On the child dropdown menu choose "Paste".
261
262To copy something from the Vim window to the clipboard,
263
2641) Select the control box to get the control drop down menu.
2652) Select "Edit".
2663) Select "Mark".
2674) Using either the keys or the mouse, select the part of the Vim window that
268   you want to copy.  To use the keys, use the arrow keys, and hold down shift
269   to extend the selection.
2705) When you've completed your selection, press 'enter'.  The selection
271   is now in the windows clipboard.  By the way, this can be any
272   rectangular selection, for example columns 4-25 in rows 7-10.  It can
273   include anything in the VIM window: the output of a :!dir, for
274   example.
275
276 vim:tw=78:ts=8:ft=help:norl:
277