1 *os_msdos.txt* For Vim version 7.2. Last change: 2005 Mar 29
4 VIM REFERENCE MANUAL by Bram Moolenaar
7 *msdos* *ms-dos* *MSDOS* *MS-DOS*
8 This file contains the particularities for the MS-DOS version of Vim.
10 1. Two versions for MS-DOS |msdos-versions|
11 2. Known problems |msdos-problems|
12 3. Long file names |msdos-longfname|
13 4. Termcap codes |msdos-termcap|
14 5. Shifted arrow keys |msdos-arrows|
15 6. Filename extensions |msdos-fname-extensions|
16 7. Memory usage and limitations |msdos-limitations|
17 8. Symbolically linked files |msdos-linked-files|
18 9. Copy/paste in a dos box |msdos-copy-paste|
20 Additionally, there are a number of common Win32 and DOS items:
21 File locations |dos-locations|
22 Using backslashes |dos-backslash|
23 Standard mappings |dos-standard-mappings|
24 Screen output and colors |dos-colors|
25 File formats |dos-file-formats|
27 Interrupting |dos-CTRL-Break|
28 Temp files |dos-temp-files|
29 Shell option default |dos-shell|
31 For compiling Vim see src/INSTALL.pc. *msdos-compiling*
33 ==============================================================================
34 1. Two versions for MS-DOS *msdos-versions*
36 There are two versions of Vim that can be used with MS-DOS machines:
39 Dos16 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.
44 Dos32 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.
49 There are also two versions that run under Windows:
50 Win32 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|
53 Win32 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|.
57 It is recommended to use the Dos32 or Win32 version. Although the Dos16
58 version is able to edit very big files, it quickly runs out of memory when
59 making big changes. Disabling undo helps: ":set ul=-1". The screen updating
60 of the Dos16 version is the fastest of the three on DOS or Windows 95; on
61 Windows NT, the Win32 version is just as fast.
64 For the Dos32 version, you may need a DPMI driver when running in MS-DOS. If
65 you are running Windows or installed a clever memory manager, it will probably
66 work already. If you get the message "No DPMI", you need to install a DPMI
67 driver. 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".
73 The 16 bit DOS version has been compiled with minimal features. Check the
74 |+feature-list| which ones are included (marked with a "T").
75 You can include more features by editing feature.h and recompiling.
77 ==============================================================================
78 2. Known problems *msdos-problems*
80 When using smartdrive (MS-DOS 6.x) with write-behind caching, it is possible
81 that Vim will try to create a swap file on a read-only file system (e.g.
82 write protected floppy). You will then be given the message >
83 A serious disk error has occurred .., Retry (r)?
84 There is nothing you can do but unprotect the floppy or switch off the
85 computer. Even CTRL-ALT-DEL will not get you out of this. This is really a
86 problem of smartdrive, not Vim. Smartdrive works fine otherwise. If this
87 bothers you, don't use the write-behind caching.
89 Vim can't read swap files that have been opened already, unless the "share"
90 command has been used. If you see stray warnings for existing swap files,
91 include the "share" command in your config.sys or autoexec.bat (see your MSDOS
94 The Dos16 version can only have about 10 files open (in a window or hidden) at
95 one time. With more files you will get error messages when trying to read or
96 write a file, and for filter commands. Or Vim runs out of memory, and random
99 The Dos32 version cannot have an unlimited number of files open at any one
100 time. The limit depends on the setting of FILES in your CONFIG.SYS. This
101 defaults to 15; if you need to edit a lot of files, you should increase this.
102 If you do not set FILES high enough, you can get strange errors, and shell
103 commands may cause a crash!
105 The Dos32 version can work with long file names. When doing file name
106 completion, matches for the short file name will also be found. But this will
107 result in the corresponding long file name. For example, if you have the long
108 file 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".
111 When using the Dos32 version and you run into problems with DPMI support,
112 check if there is a program in your config.sys that eats resources. One
113 program known to cause this problem is "netx", which says "NetWare v. 3.26
114 Workstation shell". Replace it with version 3.32 to fix the problem.
116 The Dos32 version will parse its arguments to handle quotation. This is good
117 to edit a file with spaces in its name, for example: >
118 vim "program files\accessories\ppp.scp"
119 A side effect is that single quotes are removed. Insert a backslash to avoid
120 that. For example, to edit the file "fi'le.txt": >
123 ==============================================================================
124 3. Long file names *msdos-longfname*
126 If the Dos32 version is run on Windows 95, it can use long file names. It
127 will work by default. If you want to disable this, use this setting:
129 You can put this in your autoexec.bat file.
131 Note: 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
133 on using long file names then.
135 ==============================================================================
136 4. Termcap codes *msdos-termcap*
138 If you want to use another output method (e.g., when using a terminal on a COM
139 port), set the terminal name to "pcansi". You can change the termcap options
140 when needed (see |terminal-options|). Note that the
141 normal IBM ansi.sys does not support all the codes of the builtin pcansi
142 terminal. If you use ansi.sys, you will need to delete the termcap entries
145 Otherwise, the screen will not be updated correctly. It is better to use
146 nansi.sys, nnansi.sys, or the like instead of ansi.sys.
148 If 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.
150 CTRL-C and CTRL-P may not work correctly with 'bioskey' reset.
152 ==============================================================================
153 5. Shifted arrow keys *msdos-arrows*
155 Use CTRL-arrow-left and CTRL-arrow-right instead of SHIFT-arrow-left and
156 SHIFT-arrow-right. The arrow-up and arrow-down cannot be used with SHIFT or
159 ==============================================================================
160 6. Filename extensions *msdos-fname-extensions*
162 MS-DOS allows for only one file name extension. Therefore, when appending an
163 extension, the '.' in the original file name is replaced with a '_', the name
164 is truncated to 8 characters, and the new extension (e.g., ".swp") is
165 appended. Two examples: "test.c" becomes "test_c.bak", "thisisat.est"
166 becomes "thisisat.bak". To reduce these problems, the default for
167 'backupext' is "~" instead of ".bak". The backup file for "thisisat.est"
168 then becomes "thisisat.es~". The 'shortname' option is not available,
169 because it would always be set.
171 ==============================================================================
172 7. Memory usage and limitations *msdos-limitations*
174 A swap file is used to store most of the text. You should be able to edit
175 very large files. However, memory is used for undo and other things. If you
176 delete a lot of text, you can still run out of memory in the Dos16 version.
178 If Vim gives an "Out of memory" warning, you should stop editing. The result
179 of further editing actions is unpredictable. Setting 'undolevels' to 0 saves
180 some memory. Running the maze macros on a big maze is guaranteed to run out
181 of memory, because each change is remembered for undo. In this case set
182 'undolevels' to a negative number. This will switch off undo completely.
184 *msdos-clipboard-limits*
185 In the Dos32 version, extended memory is used to avoid these problems.
186 However, if you are using the clipboard, you can still run into memory
187 limitations because the Windows clipboard can only communicate with Vim using
188 Dos memory. This means that the largest amount of text that can be sent to
189 or received from the Windows clipboard is limited by how much free Dos memory
190 is available on your system.
192 You can usually maximize the amount of available Dos memory by adding the
193 following lines to Dos's "config.sys" file: >
196 DEVICE=C:\WINDOWS\himem.sys
197 DEVICE=C:\WINDOWS\emm386.exe RAM
199 Modifying config.sys in this way will also help to make more memory available
200 for the Dos16 version, if you are using that.
202 In the Dos16 version the line length is limited to about 32000 characters.
203 When reading a file the lines are automatically split. But editing a line
204 in such a way that it becomes too long may give unexpected results.
206 ==============================================================================
207 8. Symbolically linked files *msdos-linked-files*
209 When using Vim to edit a symbolically linked file on a unix NFS file server,
210 you may run into problems. When writing the file, Vim does not "write
211 through" the symlink. Instead, it deletes the symbolic link and creates a new
214 On Unix, Vim is prepared for links (symbolic or hard). A backup copy of the
215 original file is made and then the original file is overwritten. This assures
216 that all properties of the file remain the same. On non-Unix systems, the
217 original file is renamed and a new file is written. Only the protection bits
218 are set like the original file. However, this doesn't work properly when
219 working on an NFS-mounted file system where links and other things exist. The
220 only way to fix this in the current version is not making a backup file, by
221 ":set nobackup nowritebackup" |'writebackup'|
223 A similar problem occurs when mounting a Unix filesystem through Samba or a
224 similar system. When Vim creates a new file it will get the default user ID
225 for the mounted file system. This may be different from the original user ID.
226 To avoid this set the 'backupcopy' option to "yes".
228 ==============================================================================
229 9. Copy/paste in a dos box *msdos-copy-paste*
231 *E450* *E451* *E452* *E453* *E454*
232 The 32 bit version can copy/paste from/to the Windows clipboard directly. Use
233 the "* register. Large amounts of text can be copied this way, but it must be
234 possible to allocate memory for it, see |msdos-clipboard-limits|. When moving
235 text from one Vim to another, the type of the selection
236 (characterwise/linewise/blockwise) is passed on.
238 In other versions, the following can be used.
240 (posted to comp.editors by John Velman <velman@igate1.hac.com>)
242 How to copy/paste text from/to vim in a dos box:
244 1) 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).
252 2) To paste something _into_ Vim, put Vim in insert mode.
254 3) Put the text you want to paste on the windows clipboard.
256 4) 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.
259 5) On the resulting dropdown menu choose "Edit".
260 6) On the child dropdown menu choose "Paste".
262 To copy something from the Vim window to the clipboard,
264 1) Select the control box to get the control drop down menu.
267 4) 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.
270 5) 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
276 vim:tw=78:ts=8:ft=help:norl: