Start anew
[msysgit.git] / share / vim / vim58 / doc / os_msdos.txt
blob59db92b06275bb3de6c2ec91fe3ea4c366cb9986
1 *os_msdos.txt*  For Vim version 5.8.  Last change: 1999 Sep 14
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|
26 :cd command                     |dos-:cd|
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:
38                                                         *dos16*
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.
43                                                         *dos32*
44 Dos32 version   Requires 386 processor and a |DPMI| driver, uses all
45                 available memory.  Supports long file names, but NOT on
46                 Windows NT.  Recommended for MS-DOS, Windows 3.1 and Windows
47                 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.
63                                                                 *DPMI*
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".
72                                                         *minimal-features*
73 The 16 bit DOS version has been compiled with minimal features.  These are
74 missing:
75 |+autocmd|      autocommands
76 |+byte_offset|  ":goto" and "go"
77 |+cindent|      'cindent'
78 |+cmdline_compl| completion of mappings/abbrev. in the command line
79 |+cmdline_info| 'showcmd' and 'ruler' options
80 |+comments|     'comments'
81 |+cryptv|       'cryptv'
82 |+dialog_con|   console dialogs
83 |+digraphs|     digraph support
84 |+eval|         expression evaluation, including ":if", ":while", ":let"
85 |+ex_extra|     Ex commands ":retab", ":right", ":left", ":center", ":normal"
86 |+extra_search| 'hlsearch' and 'incsearch'
87 |+file_in_path| searching for a file in 'path': "gf", <cfile>
88 |+find_in_path| commands that search in included files, such as "[I",
89                 ":ilist", ":checkpath"
90 |+insert_expand| Insert mode expansion, such as CTRL-N, CTRL-X CTRL-F
91 |+linebreak|    'showbreak', 'breakat' and 'linebreak'
92 |+lispindent|   'lispindent'
93 |+mksession|    ":mksession"
94 |+modify_fname| modifiers for file names, e.g., "%:p:h"
95 |+quickfix|     Quickfix commands ":make", ":cnext", "-q" command-line option
96 |+scrollbind|   ":scrollbind"
97 |+smartindent|  'smartindent'
98 |+statusline|   'statusline' and 'rulerformat'
99 |+syntax|       syntax highlighting
100 |+tag_binary|   binary search in tags file
101 |+tag_old_static| old method to detect static tags
102 |+textobjects|  text objects, such as "as", "iw"
103 |+user_commands| ":command" to define new Ex commands.
104 |+viminfo|      'viminfo'
105 |+visualextra|  extra features for Visual (block) mode
106 |+wildignore|   'wildignore'
107 |+wildmenu|     'wildmenu'
108 You can include (some of) these by editing feature.h and recompiling.
110 ==============================================================================
111 2. Known problems                                       *msdos-problems*
113 When using smartdrive (MS-DOS 6.x) with write-behind caching, it is possible
114 that Vim will try to create a swap file on a read-only file system (e.g.
115 write protected floppy).  You will then be given the message
116 >       A serious disk error has occurred .., Retry (r)?
117 There is nothing you can do but unprotect the floppy or switch off the
118 computer.  Even CTRL-ALT-DEL will not get you out of this.  This is really a
119 problem of smartdrive, not Vim.  Smartdrive works fine otherwise.  If this
120 bothers you, don't use the write-behind caching.
122 Vim can't read swap files that have been opened already, unless the "share"
123 command has been used.  If you see stray warnings for existing swap files,
124 include the "share" command in your config.sys or autoexec.bat (see your MSDOS
125 documentation).
127 The Dos16 version can only have about 10 files open (in a window or hidden) at
128 one time.  With more files you will get error messages when trying to read or
129 write a file, and for filter commands.  Or Vim runs out of memory, and random
130 problems may result.
132 The Dos32 version cannot have an unlimited number of files open at any one
133 time.  The limit depends on the setting of FILES in your CONFIG.SYS. This
134 defaults to 15; if you need to edit a lot of files, you should increase this.
135 If you do not set FILES high enough, you can get strange errors, and shell
136 commands may cause a crash!
138 The Dos32 version can work with long file names.  When doing file name
139 completion, matches for the short file name will also be found.  But this will
140 result in the corresponding long file name.  For example, if you have the long
141 file name "this_is_a_test" with the short file name "this_i~1", the command
142 ":e *1" will start editing "this_is_a_test".
144 When using the Dos32 version and you run into problems with DPMI support,
145 check if there is a program in your config.sys that eats resources.  One
146 program known to cause this problem is "netx", which says "NetWare v. 3.26
147 Workstation shell".  Replace it with version 3.32 to fix the problem.
149 The Dos32 version will parse its arguments to handle quotation.  This is good
150 to edit a file with spaces in its name, for example:
151 >       vim "program files\accessories\ppp.scp"
152 A side effect is that single quotes are removed.  Insert a backslash to avoid
153 that.  For example, to edit the file "fi'le.txt":
154 >       vim fi\'le.txt
156 ==============================================================================
157 3. Long file names                                      *msdos-longfname*
159 If the Dos32 version is run on Windows 95, it can use long file names.  It
160 will work by default.  If you want to disable this, use this setting:
161         set LFN=N
162 You can put this in your autoexec.bat file.
164 Note: If you have installed DJGPP on your machine, you probably have a
165 "djgpp.env" file, which contains "LFN=n".  You need to use "LFN=Y" to switch
166 on using long file names then.
168 ==============================================================================
169 4. Termcap codes                                        *msdos-termcap*
171 If you want to use another output method (e.g., when using a terminal on a COM
172 port), set the terminal name to "pcansi".  You can change the termcap options
173 when needed (see |terminal-options|).  Note that the
174 normal IBM ansi.sys does not support all the codes of the builtin pcansi
175 terminal.  If you use ansi.sys, you will need to delete the termcap entries
176 t_al and t_dl with
177 >  :set t_al= t_dl=
178 Otherwise, the screen will not be updated correctly.  It is better to use
179 nansi.sys, nnansi.sys, or the like instead of ansi.sys.
181 If you want to use Vim on a terminal connected to a COM: port, reset the
182 'bioskey' option.  Otherwise the commands will be read from the PC keyboard.
183 CTRL-C and CTRL-P may not work correctly with 'bioskey' reset.
185 ==============================================================================
186 5. Shifted arrow keys                                   *msdos-arrows*
188 Use CTRL-arrow-left and CTRL-arrow-right instead of SHIFT-arrow-left and
189 SHIFT-arrow-right.  The arrow-up and arrow-down cannot be used with SHIFT or
190 CTRL.
192 ==============================================================================
193 6. Filename extensions                          *msdos-fname-extensions*
195 MS-DOS allows for only one file name extension.  Therefore, when appending an
196 extension, the '.' in the original file name is replaced with a '_', the name
197 is truncated to 8 characters, and the new extension (e.g., ".swp") is
198 appended.  Two examples: "test.c" becomes "test_c.bak", "thisisat.est"
199 becomes "thisisat.bak".  To reduce these problems, the default for
200 'backupext' is "~" instead of ".bak".  The backup file for "thisisat.est"
201 then becomes "thisisat.es~".  The 'shortname' option is not available,
202 because it would always be set.
204 ==============================================================================
205 7. Memory usage and limitations                 *msdos-limitations*
207 A swap file is used to store most of the text.  You should be able to edit
208 very large files.  However, memory is used for undo and other things.  If you
209 delete a lot of text, you can still run out of memory in the Dos16 version.
211 If Vim gives an "Out of memory" warning, you should stop editing.  The result
212 of further editing actions is unpredictable.  Setting 'undolevels' to 0 saves
213 some memory.  Running the maze macros on a big maze is guaranteed to run out
214 of memory, because each change is remembered for undo.  In this case set
215 'undolevels' to a negative number.  This will switch off undo completely.
217 In the Dos32 version, extended memory is used to avoid these problems.
219 In the Dos16 version the line length is limited to about 32000 characters.
220 When reading a file the lines are automatically split.  But editing a line
221 in such a way that it becomes too long may give unexpected results.
223 ==============================================================================
224 8. Symbolically linked files                    *msdos-linked-files*
226 When using Vim to edit a symbolically linked file on a unix NFS file server,
227 you may run into problems.
228 When writing the file, Vim does not "write through" the symlink.  Instead, it
229 deletes the symbolic link and creates a new file in its place.
230    On Unix, Vim is prepared for links (symbolic or hard).  A backup copy of
231 the original file is made and then the original file is overwritten.  This
232 assures that all properties of the file remain the same.  On non-Unix systems,
233 the original file is renamed and a new file is written.  Only the protection
234 bits are set like the original file.  However, this doesn't work properly when
235 working on an NFS-mounted file system where links and other things exist.  The
236 only way to fix this in the current version is not making a backup file, by
237 ":set nobackup nowritebackup"   |'writebackup'|
239 ==============================================================================
240 9. Copy/paste in a dos box                      *msdos-copy-paste*
242 (posted to comp.editors by John Velman <velman@igate1.hac.com>)
244 How to copy/paste text from/to vim in a dos box:
246 1) to get VIM to run in a window, instead of full screen, press alt+enter.
247    This toggles back and forth between full screen and a dos window.
248    NOTE: In Windows 95 you must have the property "Fast Pasting" unchecked!
249    In the properties dialog box for the MS-DOS window, go to "MS-DOS
250    Prompt/Misc/Fast pasting" and make sure that it is NOT checked.
251    To make this permanent, change the properties for
252    "\windows\system\conagent.exe" (from Philip Nelson, unverified).
254 2) To paste something _into_ Vim, put Vim in insert mode.
256 3) put the text you want to paste on the windows clipboard.
258 4) Click the control box in the upper left of the Vim window. (This looks
259    like a big minus sign). If you don't want to use the mouse, you can get
260    this with alt+spacebar.
261 5) on the resulting dropdown menu choose "Edit"
262 6) on the child dropdown menu choose "Paste"
264 To copy something from the Vim window to the clipboard,
266 1) select the control box to get the control drop down menu.
267 2) select "Edit".
268 3) select "Mark"
269 4) using either the keys or the mouse, select the part of the Vim window that
270    you want to copy. To use the keys, use the arrow keys, and hold down shift
271    to extend the selection.
272 5) when you've completed your selection, press 'enter.' The selection
273    is now in the windows clipboard. By the way, this can be any
274    rectangular selection, for example columns 4-25 in rows 7-10. It can
275    include anything in the VIM window: the output of a :!dir, for
276    example.
278  vim:ts=8:sw=8:tw=78: