home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / vim53os2.zip / vim-5.3 / doc / os_dos.txt < prev    next >
Text File  |  1998-08-30  |  12KB  |  283 lines

  1. *os_dos.txt*    For Vim version 5.3.  Last modification: 1998 Aug 30
  2.  
  3.  
  4.           VIM REFERENCE MANUAL    by Bram Moolenaar
  5.  
  6.  
  7.                                 *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|.
  10.  
  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|
  20.  
  21. ==============================================================================
  22. 1. File locations                    *dos-locations*
  23.  
  24. If you keep the Vim executable in the same directory as the help and syntax
  25. files, there is no need to do anything special for Vim to work.  No registry
  26. entries or environment variables need to be set.  Just make sure that the
  27. directory is in your search path, or use a shortcut on the desktop.
  28.  
  29. If the executable is in a different directory than the support files, you
  30. should set the environment variable $VIM to the directory where the Vim
  31. documentation files are.  If $VIM is used but not defined, $HOME is tried too.
  32.  
  33. Under Windows 95, $VIM can be set in your C:\autoexec.bat file.  For example:
  34. >  set VIM=D:\vim
  35. Under Windows NT, you can set environment variables for each user separately,
  36. under "Start/Settings/Control Panel->System".  Or get the properties from the
  37. menu of "My Computer", in the Environment Tab.
  38.  
  39. If the $HOME environment variable is not set, the value "C:/" is used as a
  40. default.
  41.  
  42. If no $VIM or $HOME environment variables are set, then vim (gvim) will
  43. find the  _vimrc file in the same directory as the vim (gvim) executable.
  44.  
  45. Likewise, the documentation will be found in the doc subdirectory of that
  46. place, and the $VIM internal variable will be set to the exe place.  This
  47. means you will be able to edit the _vimrc file by doing:
  48. >  :e $VIM/_vimrc
  49.  
  50. The default help file name is "$VIM\doc\help.txt".  If the environment variable
  51. $VIM is not defined or the file is not found, the DOS or Win32 search path is
  52. used to search for the file "help.txt".  If you do not want to put "help.txt"
  53. in your search path, use the command ":set helpfile=pathname" to tell Vim
  54. where the help file is.  Also see |$VIM| and |'helpfile'|.
  55.  
  56. Vim will look for initializations in eight places.  The first that is found
  57. is used and the others are ignored.  The order is:
  58.     -  The environment variable $VIMINIT
  59.     -  The file "$VIM/_vimrc"
  60.     -  The file "$HOME/_vimrc"
  61.     -  The file "$VIM/.vimrc"
  62.     -  The file "$HOME/.vimrc"
  63.     -  The environment variable $EXINIT
  64.     -  The file "$VIM/_exrc"
  65.     -  The file "$HOME/_exrc"
  66.  
  67. ==============================================================================
  68. 2. Using backslashes                    *dos-backslash*
  69.  
  70. Using backslashes in file names can be a problem.  Vi halves the number of
  71. backslashes for some commands.  Vim is a bit more tolerant and backslashes
  72. are not removed from a file name, so ":e c:\foo\bar" works as expected.  But
  73. when a backslash is used before a special character (space, comma, backslash,
  74. etc.), it is removed.  Use slashes to avoid problems: ":e c:/foo/bar" works
  75. fine.  Vim will replace the slashes with backslashes internally, to avoid
  76. problems with some MS-DOS programs and Win32 programs.
  77.  
  78. ==============================================================================
  79. 3. Standard mappings                *dos-standard-mappings*
  80.  
  81. CTRL-PageUp    cursor to first screen line            *<C-PageUp>*
  82. CTRL-PageDown    cursor to last screen line, last character    *<C-PageDown>*
  83.  
  84. This is accomplished with these mappings:
  85.  
  86. key        key code     Normal/Visual mode        Insert mode ~
  87. CTRL-PageUp    <M-N><M-C-D>        H            <C-O>H
  88. CTRL-PageDown    <M-N>v            L$            <C-O>L<C-O>$
  89.  
  90. Additionally, these keys are used for copy/cut/paste.  Only in the Win32
  91. version they use the clipboard.
  92.  
  93. Shift-Insert    paste text (from clipboard)            *<S-Insert>*
  94. CTRL-Insert    copy Visual text (to clipboard)            *<C-Insert>*
  95. CTRL-Del    cut Visual text (to clipboard)            *<C-Del>*
  96. Shift-Del    cut Visual text (to clipboard)            *<S-Del>*
  97.  
  98. This is accomplished with these mappings (Win32 version of Vim):
  99.  
  100. key        key code     Normal    Visual        Insert ~
  101. Shift-Insert    <M-N><M-T>   "*P    "-d"*P      <C-O>"*P
  102. CTRL-Insert    <M-N><M-U>        "*y
  103. Shift-Del    <M-N><M-W>        "*d
  104. CTRL-Del    <M-N><M-X>        "*d
  105.  
  106. Or these mappings (non-Win32 version of Vim):
  107.  
  108. key        key code     Normal    Visual        Insert ~
  109. Shift-Insert    <M-N><M-T>   P        d"0P        <C-O>P
  110. CTRL-Insert    <M-N><M-U>        y
  111. Shift-Del    <M-N><M-W>        d
  112. CTRL-Del    <M-N><M-X>        d
  113.  
  114. ==============================================================================
  115. 4. Screen output and colors                *dos-colors*
  116.  
  117. The default output method for the screen is to use bios calls.  This will work
  118. right away on most systems.  You do not need ansi.sys.  You can use ":mode" to
  119. set the current screen mode.  See |:mode|.
  120.  
  121. To change the screen colors that Vim uses, the |:highlight| command can be
  122. used.  The Normal highlight group has the colors to be used for normal text.
  123. For example, to get grey text on a blue background:
  124.     :hi Normal ctermbg=Blue ctermfg=grey
  125. See |highlight-groups| for other groups that can be used.
  126.  
  127. A DOS console does not support attributes like bold and underlining.  You can
  128. set the color used in five modes with nine termcap options.  Note that this is
  129. not really needed, since you can set the color directly with the ":highlight"
  130. command.  This is for backwards compatibility with older Vim versions.
  131. Which of the five modes is used for which action depends on the |'highlight'|
  132. option.
  133.  
  134.     ":set t_mr=^V^[\|xxm"        start of invert mode
  135.     ":set t_md=^V^[\|xxm"        start of bold mode
  136.     ":set t_me=^V^[\|xxm"        back to normal text
  137.  
  138.     ":set t_so=^V^[\|xxm"        start of standout mode
  139.     ":set t_se=^V^[\|xxm"        back to normal text
  140.  
  141.     ":set t_us=^V^[\|xxm"        start of underline mode
  142.     ":set t_ue=^V^[\|xxm"        back to normal text
  143.  
  144.     ":set t_ZH=^V^[\|xxm"        start of italics mode
  145.     ":set t_ZR=^V^[\|xxm"        back to normal text
  146.  
  147. ^V is CTRL-V
  148. ^[ is <Esc>
  149. xx must be replaced with a decimal code, which is the foreground color number
  150.    and background color number added together:
  151.  
  152. COLOR            FOREGROUND    BACKGROUND    ~
  153. Black                0            0
  154. DarkBlue            1           16
  155. DarkGreen            2           32
  156. DarkCyan            3           48
  157. DarkRed                4           64
  158. DarkMagenta            5           80
  159. Brown                6           96
  160. LightGray            7          112
  161. DarkGray            8          128 *
  162. Blue, LightBlue            9          144 *
  163. Green, LightGreen       10          160 *
  164. Cyan, LightCyan           11          176 *
  165. Red, LightRed           12          192 *
  166. Magenta, LightMagenta       13          208 *
  167. Yellow               14          224 *
  168. White               15          240 *
  169.  
  170. * Depending on the display mode, the color codes above 128 may not be
  171.   available, and code 128 will make the text blink.
  172.  
  173. When you use 0, the color is reset to the one used when you started Vim
  174. (usually 7, lightgray on black, but you can override this.  If you have
  175. overridden the default colors in a command prompt, you may need to adjust
  176. some of the highlight colors in your vimrc---see below).
  177. This is the default for t_me.
  178.  
  179. The defaults for the various highlight modes are:
  180.     t_mr    112     reverse mode: Black text (0) on LightGray (112)
  181.     t_md     15     bold mode: White text (15) on Black (0)
  182.     t_me      0     normal mode (revert to default)
  183.  
  184.     t_so     31     standout mode: White (15) text on DarkBlue (16)
  185.     t_se      0     standout mode end (revert to default)
  186.  
  187.     t_czh    225     italic mode: DarkBlue text (1) on Yellow (224)
  188.     t_czr      0     italic mode end (revert to default)
  189.  
  190.     t_us     67     underline mode: DarkCyan text (3) on DarkRed (64)
  191.     t_ue      0     underline mode end (revert to default)
  192.  
  193. These colors were chosen because they also look good when using an inverted
  194. display, but you can change them to your liking.
  195.  
  196. Example:
  197. >  :set t_mr=^V^[\|97m    " start of invert mode: DarkBlue (1) on Brown (96)
  198. >  :set t_md=^V^[\|67m    " start of bold mode: DarkCyan (3) on DarkRed (64)
  199. >  :set t_me=^V^[\|112m    " back to normal mode: Black (0) on LightGray (112)
  200. >
  201. >  :set t_so=^V^[\|37m    " start of standout mode: DarkMagenta (5) on DarkGreen
  202. >                                    (32)
  203. >  :set t_se=^V^[\|112m    " back to normal mode: Black (0) on LightGray (112)
  204.  
  205. ==============================================================================
  206. 5. File formats                        *dos-file-formats*
  207.  
  208. If the 'fileformat' option is set to "dos" (which is the default), Vim will
  209. accept a single <NL> or a <CR><NL> pair for end-of-line (<EOL>).  When writing
  210. a file, Vim will use <CR><NL>.  Thus, if you edit a file and write it, <NL> is
  211. replaced with <CR><NL>.
  212. If the 'fileformat' option is set to "unix", a single <NL> will be used for
  213. <EOL>.  A <CR> will be shown as ^M.
  214. You can use Vim to replace <NL> with <CR><NL> by reading in any mode and
  215. writing in Dos mode (":se ff=dos").
  216. You can use Vim to replace <CR><NL> with <NL> by reading in Dos mode and
  217. writing in Unix mode (":se ff=unix").
  218. 'fileformat' is set automatically when 'fileformats' is not empty (which is
  219. the default), so you don't really have to worry about what you are doing.
  220.                     |'fileformat'| |'fileformats'|
  221.  
  222. If you want to edit a script file or a binary file, you should set the
  223. 'binary' option before loading the file.  Script files and binary files may
  224. contain single <NL> characters which would be replaced with <CR><NL>.  You can
  225. set 'binary' automatically by starting Vim with the "-b" (binary) option.
  226.  
  227. ==============================================================================
  228. 6. :cd command                        *dos-:cd*
  229.  
  230. The ":cd" command recognizes the drive specifier and changes the current
  231. drive.  Use ":cd c:" to make drive C the active drive.  Use ":cd d:\foo" to go
  232. to the directory "foo" in the root of drive D.  UNC names are also recognized
  233. (if the system supports them); e.g., ":cd \\server\share\dir".  |:cd|
  234.  
  235. ==============================================================================
  236. 7. Interrupting                        *dos-CTRL-Break*
  237.  
  238. Use CTRL-Break instead of CTRL-C to interrupt searches.  The CTRL-C is not
  239. detected until a key is read.
  240.  
  241. ==============================================================================
  242. 8. Temp files                        *dos-temp-files*
  243.  
  244. Temporary files (for filtering) are put in the first directory in the next
  245. list that exists and where a file can be created:
  246.     $TMP
  247.     $TEMP
  248.     C:\TMP
  249.     C:\TEMP
  250.     current directory
  251.  
  252. ==============================================================================
  253. 9. Shell option default                    *dos-shell*
  254.  
  255. The default for the 'sh' ('shell') option is "command.com" on Windows 95 and
  256. "cmd.exe" on Windows NT.  If SHELL is defined, it is used instead, and if
  257. SHELL is not defined but COMSPEC is, COMPSPEC is used.  External commands are
  258. started with "<shell> /c <command_name>".  Typing CTRL-Z starts a new
  259. command subshell.  Return to Vim with "exit".        |'shell'| |CTRL-Z|
  260.  
  261. If you are running a third-party shell, you may need to set the
  262. |'shellcmdflag'| ('shcf') and |'shellquote'| ('shq') or |'shellxquote'|
  263. ('sxq') options.  Unfortunately, this also depends on the version of Vim used.
  264. For example, with the MKS Korn shell or with bash, the values of the options
  265. should be:
  266.  
  267.         DOS 16 bit        DOS 32 bit        Win32  ~
  268. 'shellcmdflag'       -c            -c         -c
  269. 'shellquote'       "
  270. 'shellxquote'                         "
  271.  
  272. For Dos 16 bit this will start the shell as:
  273.     <shell> -c "command name" >file
  274. For Win32 as:
  275.     <shell> -c "command name >file"
  276. For DOS 32 bit, DJGPP does this internally somehow.
  277.  
  278. When starting up, Vim will check for the presence of "sh" anywhere in the
  279. 'shell' option.  If it is present, the 'shellcmdflag' and 'shellquote' or
  280. 'shellxquote' options will be set as mentioned above
  281.  
  282.  vim:ts=8:sw=8:tw=78:
  283.