Add /src/vim/release.sh, a script to compile and install vim
[msysgit.git] / share / vim / vim58 / doc / os_dos.txt
blob2c90d2d380258724a26be7990440471d3db3efcb
1 *os_dos.txt*    For Vim version 5.8.  Last change: 1999 Dec 07
4                   VIM REFERENCE MANUAL    by Bram Moolenaar
7                                                         *dos* *DOS*
8 This file documents the common particularities of the MS-DOS and Win32
9 versions of Vim.  Also see |os_win32.txt| and |os_msdos.txt|.
11 1. File locations               |dos-locations|
12 2. Using backslashes            |dos-backslash|
13 3. Standard mappings            |dos-standard-mappings|
14 4. Screen output and colors     |dos-colors|
15 5. File formats                 |dos-file-formats|
16 6. :cd command                  |dos-:cd|
17 7. Interrupting                 |dos-CTRL-Break|
18 8. Temp files                   |dos-temp-files|
19 9. Shell option default         |dos-shell|
21 ==============================================================================
22 1. File locations                                       *dos-locations*
24 If you keep the Vim executable in the directory that contains the help and
25 syntax subdirectories, there is no need to do anything special for Vim to
26 work.  No registry entries or environment variables need to be set.  Just make
27 sure that the directory is in your search path, or use a shortcut on the
28 desktop.
30 Your vimrc files ("_vimrc" and "_gvimrc") are normally located one directory
31 up from the runtime files.  If you want to put them somewhere else, set the
32 environment variable $VIM to the directory where you keep them.  Example:
33 >       set VIM=C:\user\piet
34 Will find "c:\user\piet\_vimrc".
36 If you move the executable to another location, you also need to set the $VIM
37 environment variable.  The runtime files will be found in "$VIM/vim{version}".
38 Example:
39 >       set VIM=E:\vim
40 Will find the version 5.4 runtime files in "e:\vim\vim54".
42 If you move your executable AND want to put your "_vimrc" and "_gvimrc" files
43 somewhere else, you must set $VIM to where you vimrc files are, and set
44 $VIMRUNTIME to the runtime files.  Example:
45 >       set VIM=C:\usr\piet
46 >       set VIMRUNTIME=E:\vim\vim54
47 Will find "c:\user\piet\_vimrc" and the runtime files in "e:\vim\vim54".
49 See |$VIM| and |$VIMRUNTIME| for more information.
51 Under Windows 95, you can set $VIM in your C:\autoexec.bat file.  For example:
52 >  set VIM=D:\vim
53 Under Windows NT, you can set environment variables for each user separately
54 under "Start/Settings/Control Panel->System", or through the properties in the
55 menu of "My Computer", under the Environment Tab.
57 ==============================================================================
58 2. Using backslashes                                    *dos-backslash*
60 Using backslashes in file names can be a problem.  Vi halves the number of
61 backslashes for some commands.  Vim is a bit more tolerant and does not remove
62 backslashes from a file name, so ":e c:\foo\bar" works as expected.  But when
63 a backslash occurs before a special character (space, comma, backslash, etc.),
64 Vim removes the backslash.  Use slashes to avoid problems: ":e c:/foo/bar"
65 works fine.  Vim replaces the slashes with backslashes internally to avoid
66 problems with some MS-DOS programs and Win32 programs.
68 When you prefer to use forward slashes, set the 'shellslash' option.  Vim will
69 then replace backslashes with forward slashes when expanding file names.  This
70 is especially useful when using a Unix-like 'shell'.
72 ==============================================================================
73 3. Standard mappings                            *dos-standard-mappings*
75 CTRL-PageUp     cursor to first screen line                     *<C-PageUp>*
76 CTRL-PageDown   cursor to last screen line, last character      *<C-PageDown>*
78 These mappings accomplish this:
80 key             key code     Normal/Visual mode     Insert mode ~
81 CTRL-PageUp     <M-N><M-C-D>        H               <C-O>H
82 CTRL-PageDown   <M-N>v              L$              <C-O>L<C-O>$
84 Additionally, these keys are available for copy/cut/paste.  In the Win32
85 version only, they also use the clipboard.
87 Shift-Insert    paste text (from clipboard)                     *<S-Insert>*
88 CTRL-Insert     copy Visual text (to clipboard)                 *<C-Insert>*
89 CTRL-Del        cut Visual text (to clipboard)                  *<C-Del>*
90 Shift-Del       cut Visual text (to clipboard)                  *<S-Del>*
92 These mappings accomplish this (Win32 version of Vim):
94 key             key code     Normal     Visual      Insert ~
95 Shift-Insert    <M-N><M-T>   "*P        "-d"*P      <C-O>"*P
96 CTRL-Insert     <M-N><M-U>              "*y
97 Shift-Del       <M-N><M-W>              "*d
98 CTRL-Del        <M-N><M-X>              "*d
100 Or these mappings (non-Win32 version of Vim):
102 key             key code     Normal     Visual      Insert ~
103 Shift-Insert    <M-N><M-T>   P          d"0P        <C-O>P
104 CTRL-Insert     <M-N><M-U>              y
105 Shift-Del       <M-N><M-W>              d
106 CTRL-Del        <M-N><M-X>              d
108 ==============================================================================
109 4. Screen output and colors                             *dos-colors*
111 The default output method for the screen is to use bios calls.  This works
112 right away on most systems.  You do not need ansi.sys.  You can use ":mode" to
113 set the current screen mode.  See |:mode|.
115 To change the screen colors that Vim uses, you can use the |:highlight|
116 command.  The Normal highlight group specifies the colors Vim uses for normal
117 text.  For example, to get grey text on a blue background:
118 >       :hi Normal ctermbg=Blue ctermfg=grey
119 See |highlight-groups| for other groups that are available.
121 A DOS console does not support attributes like bold and underlining.  You can
122 set the color used in five modes with nine termcap options.  Note that this is
123 not necessary since you can set the color directly with the ":highlight"
124 command; these options are for backward compatibility with older Vim versions.
125 The |'highlight'| option specifies which of the five modes is used for which
126 action.
128 >       :set t_mr=^V^[\|xxm             start of invert mode
129 >       :set t_md=^V^[\|xxm             start of bold mode
130 >       :set t_me=^V^[\|xxm             back to normal text
132 >       :set t_so=^V^[\|xxm             start of standout mode
133 >       :set t_se=^V^[\|xxm             back to normal text
135 >       :set t_us=^V^[\|xxm             start of underline mode
136 >       :set t_ue=^V^[\|xxm             back to normal text
138 >       :set t_ZH=^V^[\|xxm             start of italics mode
139 >       :set t_ZR=^V^[\|xxm             back to normal text
141 ^V is CTRL-V
142 ^[ is <Esc>
143 You must replace xx with a decimal code, which is the foreground color number
144 and background color number added together:
146 COLOR                   FOREGROUND      BACKGROUND      ~
147 Black                       0               0
148 DarkBlue                    1              16
149 DarkGreen                   2              32
150 DarkCyan                    3              48
151 DarkRed                     4              64
152 DarkMagenta                 5              80
153 Brown                       6              96
154 LightGray                   7             112
155 DarkGray                    8             128 *
156 Blue, LightBlue             9             144 *
157 Green, LightGreen          10             160 *
158 Cyan, LightCyan            11             176 *
159 Red, LightRed              12             192 *
160 Magenta, LightMagenta      13             208 *
161 Yellow                     14             224 *
162 White                      15             240 *
164 * Depending on the display mode, the color codes above 128 may not be
165   available, and code 128 will make the text blink.
167 When you use 0, the color is reset to the one used when you started Vim
168 (usually 7, lightgray on black, but you can override this.  If you have
169 overridden the default colors in a command prompt, you may need to adjust
170 some of the highlight colors in your vimrc---see below).
171 This is the default for t_me.
173 The defaults for the various highlight modes are:
174         t_mr    112      reverse mode: Black text (0) on LightGray (112)
175         t_md     15      bold mode: White text (15) on Black (0)
176         t_me      0      normal mode (revert to default)
178         t_so     31      standout mode: White (15) text on DarkBlue (16)
179         t_se      0      standout mode end (revert to default)
181         t_czh   225      italic mode: DarkBlue text (1) on Yellow (224)
182         t_czr     0      italic mode end (revert to default)
184         t_us     67      underline mode: DarkCyan text (3) on DarkRed (64)
185         t_ue      0      underline mode end (revert to default)
187 These colors were chosen because they also look good when using an inverted
188 display, but you can change them to your liking.
190 Example:
191 >  :set t_mr=^V^[\|97m  " start of invert mode: DarkBlue (1) on Brown (96)
192 >  :set t_md=^V^[\|67m  " start of bold mode: DarkCyan (3) on DarkRed (64)
193 >  :set t_me=^V^[\|112m " back to normal mode: Black (0) on LightGray (112)
195 >  :set t_so=^V^[\|37m  " start of standout mode: DarkMagenta (5) on DarkGreen
196 >                                                                       (32)
197 >  :set t_se=^V^[\|112m " back to normal mode: Black (0) on LightGray (112)
199 ==============================================================================
200 5. File formats                                         *dos-file-formats*
202 If the 'fileformat' option is set to "dos" (which is the default), Vim accepts
203 a single <NL> or a <CR><NL> pair for end-of-line (<EOL>).  When writing a
204 file, Vim uses <CR><NL>.  Thus, if you edit a file and write it, Vim replaces
205 <NL> with <CR><NL>.
207 If the 'fileformat' option is set to "unix", Vim uses a single <NL> for <EOL>
208 and shows <CR> as ^M.
210 You can use Vim to replace <NL> with <CR><NL> by reading in any mode and
211 writing in Dos mode (":se ff=dos").
212 You can use Vim to replace <CR><NL> with <NL> by reading in Dos mode and
213 writing in Unix mode (":se ff=unix").
215 Vim sets 'fileformat' automatically when 'fileformats' is not empty (which is
216 the default), so you don't really have to worry about what you are doing.
217                                         |'fileformat'| |'fileformats'|
219 If you want to edit a script file or a binary file, you should set the
220 'binary' option before loading the file.  Script files and binary files may
221 contain single <NL> characters which Vim would replace with <CR><NL>.  You can
222 set 'binary' automatically by starting Vim with the "-b" (binary) option.
224 ==============================================================================
225 6. :cd command                                          *dos-:cd*
227 The ":cd" command recognizes the drive specifier and changes the current
228 drive.  Use ":cd c:" to make drive C the active drive.  Use ":cd d:\foo" to go
229 to the directory "foo" in the root of drive D.  Vim also recognizes UNC names
230 if the system supports them; e.g., ":cd \\server\share\dir".  |:cd|
232 ==============================================================================
233 7. Interrupting                                         *dos-CTRL-Break*
235 Use CTRL-Break instead of CTRL-C to interrupt searches.  Vim does not detect
236 the CTRL-C until it tries to read a key.
238 ==============================================================================
239 8. Temp files                                           *dos-temp-files*
241 Only for the 16 bit and 32 bit DOS version:
242 Vim puts temporary files (for filtering) in the first of these directories
243 that exists and in which Vim can create a file:
244         $TMP
245         $TEMP
246         C:\TMP
247         C:\TEMP
248         current directory
250 For the Win32 version (both console and GUI):
251 Vim uses standard Windows functions to obtain a temporary file name (for
252 filtering).  The first of these directories that exists and in which Vim can
253 create a file is used:
254         $TMP
255         $TEMP
256         current directory
258 ==============================================================================
259 9. Shell option default                                 *dos-shell*
261 The default for the 'sh' ('shell') option is "command.com" on Windows 95 and
262 "cmd.exe" on Windows NT.  If SHELL is defined, Vim uses SHELL instead, and if
263 SHELL is not defined but COMSPEC is, Vim uses COMSPEC.  Vim starts external
264 commands with "<shell> /c <command_name>".  Typing CTRL-Z starts a new command
265 subshell.  Return to Vim with "exit".   |'shell'| |CTRL-Z|
267 If you are running a third-party shell, you may need to set the
268 |'shellcmdflag'| ('shcf') and |'shellquote'| ('shq') or |'shellxquote'|
269 ('sxq') options.  Unfortunately, this also depends on the version of Vim used.
270 For example, with the MKS Korn shell or with bash, the values of the options
271 should be:
273                 DOS 16 bit          DOS 32 bit          Win32  ~
274 'shellcmdflag'     -c                   -c               -c
275 'shellquote'       "
276 'shellxquote'                                            "
278 For Dos 16 bit this starts the shell as:
279         <shell> -c "command name" >file
280 For Win32 as:
281         <shell> -c "command name >file"
282 For DOS 32 bit, DJGPP does this internally somehow.
284 When starting up, Vim checks for the presence of "sh" anywhere in the 'shell'
285 option.  If it is present, Vim sets the 'shellcmdflag' and 'shellquote' or
286 'shellxquote' options will be set as described above.
288  vim:ts=8:sw=8:tw=78: