Mercurial > vim
annotate runtime/doc/os_dos.txt @ 19174:d5b793803236 v8.2.0146
patch 8.2.0146: wrong indent when 'showbreak' and 'breakindent' are set
Commit: https://github.com/vim/vim/commit/dfede9a70b3136988a8f262742101ad5cb98f46d
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jan 23 19:59:22 2020 +0100
patch 8.2.0146: wrong indent when 'showbreak' and 'breakindent' are set
Problem: Wrong indent when 'showbreak' and 'breakindent' are set and
'briopt' includes "sbr".
Solution: Reset "need_showbreak" where needed. (Ken Takata, closes #5523)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 23 Jan 2020 20:00:04 +0100 |
parents | 63beef1ca62c |
children | 0ce24f734615 |
rev | line source |
---|---|
18879 | 1 *os_dos.txt* For Vim version 8.2. Last change: 2006 Mar 30 |
7 | 2 |
3 | |
4 VIM REFERENCE MANUAL by Bram Moolenaar | |
5 | |
6 | |
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|. | |
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 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. | |
29 | |
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". | |
35 Note: This would only be needed when the computer is used by several people. | |
36 Otherwise it's simpler to keep your _vimrc file in the default place. | |
37 | |
38 If you move the executable to another location, you also need to set the $VIM | |
39 environment variable. The runtime files will be found in "$VIM/vim{version}". | |
40 Example: > | |
41 set VIM=E:\vim | |
19116 | 42 Will find the version 8.2 runtime files in "e:\vim\vim82". |
7 | 43 Note: This is _not_ recommended. The preferred way is to keep the executable |
44 in the runtime directory. | |
45 | |
46 If you move your executable AND want to put your "_vimrc" and "_gvimrc" files | |
47 somewhere else, you must set $VIM to where you vimrc files are, and set | |
48 $VIMRUNTIME to the runtime files. Example: > | |
49 set VIM=C:\usr\piet | |
19116 | 50 set VIMRUNTIME=E:\vim\vim82 |
51 Will find "c:\user\piet\_vimrc" and the runtime files in "e:\vim\vim82". | |
7 | 52 |
53 See |$VIM| and |$VIMRUNTIME| for more information. | |
54 | |
19163 | 55 You can set environment variables for each user separately through the |
56 System Properties dialog box. The steps to do that: | |
57 1. Type Windows Key + R to open the "Run" dialog box. | |
58 2. Enter "sysdm.cpl" and press the "OK" button. The "System Properties" | |
59 dialog box will open. | |
60 3. Select the "Advanced" tab and press the "Environment Variables..." button. | |
61 The "Environment Variables" dialog box will open. | |
62 4. Select an existing variable in the "User variables" list and press the | |
63 "Edit..." button to edit it. Or press the "New..." button to add a new | |
64 variable. | |
65 5. After you finished editing variables, press the "OK" button to save the | |
66 changes. | |
7 | 67 |
68 ============================================================================== | |
69 2. Using backslashes *dos-backslash* | |
70 | |
71 Using backslashes in file names can be a problem. Vi halves the number of | |
72 backslashes for some commands. Vim is a bit more tolerant and does not remove | |
73 backslashes from a file name, so ":e c:\foo\bar" works as expected. But when | |
74 a backslash occurs before a special character (space, comma, backslash, etc.), | |
75 Vim removes the backslash. Use slashes to avoid problems: ":e c:/foo/bar" | |
76 works fine. Vim replaces the slashes with backslashes internally to avoid | |
77 problems with some MS-DOS programs and Win32 programs. | |
78 | |
79 When you prefer to use forward slashes, set the 'shellslash' option. Vim will | |
80 then replace backslashes with forward slashes when expanding file names. This | |
81 is especially useful when using a Unix-like 'shell'. | |
82 | |
83 ============================================================================== | |
84 3. Standard mappings *dos-standard-mappings* | |
85 | |
819 | 86 The mappings for CTRL-PageUp and CTRL-PageDown have been removed, they now |
87 jump to the next or previous tab page |<C-PageUp>| |<C-PageDown>| | |
7 | 88 |
819 | 89 If you want them to move to the first and last screen line you can use these |
90 mappings: | |
7 | 91 |
92 key key code Normal/Visual mode Insert mode ~ | |
93 CTRL-PageUp <M-N><M-C-D> H <C-O>H | |
94 CTRL-PageDown <M-N>v L$ <C-O>L<C-O>$ | |
95 | |
96 Additionally, these keys are available for copy/cut/paste. In the Win32 | |
97 and DJGPP versions, they also use the clipboard. | |
98 | |
99 Shift-Insert paste text (from clipboard) *<S-Insert>* | |
100 CTRL-Insert copy Visual text (to clipboard) *<C-Insert>* | |
101 CTRL-Del cut Visual text (to clipboard) *<C-Del>* | |
102 Shift-Del cut Visual text (to clipboard) *<S-Del>* | |
8148
f5da459c5698
commit https://github.com/vim/vim/commit/e0fa3742ead676a3074a10edadbc955e1a89153d
Christian Brabandt <cb@256bit.org>
parents:
5294
diff
changeset
|
103 CTRL-X cut Visual text (to clipboard) |
7 | 104 |
105 These mappings accomplish this (Win32 and DJGPP versions of Vim): | |
106 | |
107 key key code Normal Visual Insert ~ | |
108 Shift-Insert <M-N><M-T> "*P "-d"*P <C-R><C-O>* | |
109 CTRL-Insert <M-N><M-U> "*y | |
110 Shift-Del <M-N><M-W> "*d | |
111 CTRL-Del <M-N><M-X> "*d | |
8148
f5da459c5698
commit https://github.com/vim/vim/commit/e0fa3742ead676a3074a10edadbc955e1a89153d
Christian Brabandt <cb@256bit.org>
parents:
5294
diff
changeset
|
112 CTRL-X <C-X> "*d |
7 | 113 |
114 Or these mappings (non-Win32 version of Vim): | |
115 | |
116 key key code Normal Visual Insert ~ | |
117 Shift-Insert <M-N><M-T> P "-dP <C-R><C-O>" | |
118 CTRL-Insert <M-N><M-U> y | |
119 Shift-Del <M-N><M-W> d | |
120 CTRL-Del <M-N><M-X> d | |
121 | |
122 When the clipboard is supported, the "* register is used. | |
123 | |
124 ============================================================================== | |
125 4. Screen output and colors *dos-colors* | |
126 | |
127 The default output method for the screen is to use bios calls. This works | |
128 right away on most systems. You do not need ansi.sys. You can use ":mode" to | |
129 set the current screen mode. See |:mode|. | |
130 | |
131 To change the screen colors that Vim uses, you can use the |:highlight| | |
132 command. The Normal highlight group specifies the colors Vim uses for normal | |
133 text. For example, to get grey text on a blue background: > | |
134 :hi Normal ctermbg=Blue ctermfg=grey | |
135 See |highlight-groups| for other groups that are available. | |
136 | |
137 A DOS console does not support attributes like bold and underlining. You can | |
667 | 138 set the color used in five modes with nine terminal options. Note that this |
139 is not necessary since you can set the color directly with the ":highlight" | |
7 | 140 command; these options are for backward compatibility with older Vim versions. |
141 The |'highlight'| option specifies which of the five modes is used for which | |
142 action. > | |
143 | |
144 :set t_mr=^V^[\|xxm start of invert mode | |
145 :set t_md=^V^[\|xxm start of bold mode | |
146 :set t_me=^V^[\|xxm back to normal text | |
147 | |
148 :set t_so=^V^[\|xxm start of standout mode | |
149 :set t_se=^V^[\|xxm back to normal text | |
150 | |
151 :set t_us=^V^[\|xxm start of underline mode | |
152 :set t_ue=^V^[\|xxm back to normal text | |
153 | |
154 :set t_ZH=^V^[\|xxm start of italics mode | |
155 :set t_ZR=^V^[\|xxm back to normal text | |
156 | |
157 ^V is CTRL-V | |
158 ^[ is <Esc> | |
159 You must replace xx with a decimal code, which is the foreground color number | |
160 and background color number added together: | |
161 | |
162 COLOR FOREGROUND BACKGROUND ~ | |
163 Black 0 0 | |
164 DarkBlue 1 16 | |
165 DarkGreen 2 32 | |
166 DarkCyan 3 48 | |
167 DarkRed 4 64 | |
168 DarkMagenta 5 80 | |
169 Brown, DarkYellow 6 96 | |
170 LightGray 7 112 | |
171 DarkGray 8 128 * | |
172 Blue, LightBlue 9 144 * | |
173 Green, LightGreen 10 160 * | |
174 Cyan, LightCyan 11 176 * | |
175 Red, LightRed 12 192 * | |
176 Magenta, LightMagenta 13 208 * | |
177 Yellow, LightYellow 14 224 * | |
178 White 15 240 * | |
179 | |
180 * Depending on the display mode, the color codes above 128 may not be | |
181 available, and code 128 will make the text blink. | |
182 | |
183 When you use 0, the color is reset to the one used when you started Vim | |
184 (usually 7, lightgray on black, but you can override this. If you have | |
185 overridden the default colors in a command prompt, you may need to adjust | |
186 some of the highlight colors in your vimrc---see below). | |
187 This is the default for t_me. | |
188 | |
189 The defaults for the various highlight modes are: | |
190 t_mr 112 reverse mode: Black text (0) on LightGray (112) | |
191 t_md 15 bold mode: White text (15) on Black (0) | |
192 t_me 0 normal mode (revert to default) | |
193 | |
194 t_so 31 standout mode: White (15) text on DarkBlue (16) | |
195 t_se 0 standout mode end (revert to default) | |
196 | |
197 t_czh 225 italic mode: DarkBlue text (1) on Yellow (224) | |
198 t_czr 0 italic mode end (revert to default) | |
199 | |
200 t_us 67 underline mode: DarkCyan text (3) on DarkRed (64) | |
201 t_ue 0 underline mode end (revert to default) | |
202 | |
203 These colors were chosen because they also look good when using an inverted | |
204 display, but you can change them to your liking. | |
205 | |
206 Example: > | |
207 :set t_mr=^V^[\|97m " start of invert mode: DarkBlue (1) on Brown (96) | |
208 :set t_md=^V^[\|67m " start of bold mode: DarkCyan (3) on DarkRed (64) | |
209 :set t_me=^V^[\|112m " back to normal mode: Black (0) on LightGray (112) | |
210 | |
211 :set t_so=^V^[\|37m " start of standout mode: DarkMagenta (5) on DarkGreen | |
212 (32) | |
213 :set t_se=^V^[\|112m " back to normal mode: Black (0) on LightGray (112) | |
214 | |
215 ============================================================================== | |
216 5. File formats *dos-file-formats* | |
217 | |
218 If the 'fileformat' option is set to "dos" (which is the default), Vim accepts | |
219 a single <NL> or a <CR><NL> pair for end-of-line (<EOL>). When writing a | |
220 file, Vim uses <CR><NL>. Thus, if you edit a file and write it, Vim replaces | |
221 <NL> with <CR><NL>. | |
222 | |
223 If the 'fileformat' option is set to "unix", Vim uses a single <NL> for <EOL> | |
224 and shows <CR> as ^M. | |
225 | |
226 You can use Vim to replace <NL> with <CR><NL> by reading in any mode and | |
227 writing in Dos mode (":se ff=dos"). | |
228 You can use Vim to replace <CR><NL> with <NL> by reading in Dos mode and | |
229 writing in Unix mode (":se ff=unix"). | |
230 | |
231 Vim sets 'fileformat' automatically when 'fileformats' is not empty (which is | |
232 the default), so you don't really have to worry about what you are doing. | |
233 |'fileformat'| |'fileformats'| | |
234 | |
235 If you want to edit a script file or a binary file, you should set the | |
236 'binary' option before loading the file. Script files and binary files may | |
237 contain single <NL> characters which Vim would replace with <CR><NL>. You can | |
238 set 'binary' automatically by starting Vim with the "-b" (binary) option. | |
239 | |
240 ============================================================================== | |
241 6. :cd command *dos-:cd* | |
242 | |
243 The ":cd" command recognizes the drive specifier and changes the current | |
244 drive. Use ":cd c:" to make drive C the active drive. Use ":cd d:\foo" to go | |
245 to the directory "foo" in the root of drive D. Vim also recognizes UNC names | |
246 if the system supports them; e.g., ":cd \\server\share\dir". |:cd| | |
247 | |
248 ============================================================================== | |
249 7. Interrupting *dos-CTRL-Break* | |
250 | |
251 Use CTRL-Break instead of CTRL-C to interrupt searches. Vim does not detect | |
252 the CTRL-C until it tries to read a key. | |
253 | |
254 ============================================================================== | |
255 8. Temp files *dos-temp-files* | |
256 | |
257 Only for the 16 bit and 32 bit DOS version: | |
258 Vim puts temporary files (for filtering) in the first of these directories | |
259 that exists and in which Vim can create a file: | |
260 $TMP | |
261 $TEMP | |
262 C:\TMP | |
263 C:\TEMP | |
264 current directory | |
265 | |
266 For the Win32 version (both console and GUI): | |
267 Vim uses standard Windows functions to obtain a temporary file name (for | |
268 filtering). The first of these directories that exists and in which Vim can | |
269 create a file is used: | |
270 $TMP | |
271 $TEMP | |
272 current directory | |
273 | |
274 ============================================================================== | |
275 9. Shell option default *dos-shell* | |
276 | |
277 The default for the 'sh' ('shell') option is "command.com" on Windows 95 and | |
278 "cmd.exe" on Windows NT. If SHELL is defined, Vim uses SHELL instead, and if | |
279 SHELL is not defined but COMSPEC is, Vim uses COMSPEC. Vim starts external | |
280 commands with "<shell> /c <command_name>". Typing CTRL-Z starts a new command | |
281 subshell. Return to Vim with "exit". |'shell'| |CTRL-Z| | |
282 | |
283 If you are running a third-party shell, you may need to set the | |
284 |'shellcmdflag'| ('shcf') and |'shellquote'| ('shq') or |'shellxquote'| | |
285 ('sxq') options. Unfortunately, this also depends on the version of Vim used. | |
286 For example, with the MKS Korn shell or with bash, the values of the options | |
287 should be: | |
288 | |
289 DOS 16 bit DOS 32 bit Win32 ~ | |
290 'shellcmdflag' -c -c -c | |
291 'shellquote' " | |
292 'shellxquote' " | |
293 | |
294 For Dos 16 bit this starts the shell as: | |
295 <shell> -c "command name" >file | |
296 For Win32 as: | |
297 <shell> -c "command name >file" | |
298 For DOS 32 bit, DJGPP does this internally somehow. | |
299 | |
300 When starting up, Vim checks for the presence of "sh" anywhere in the 'shell' | |
301 option. If it is present, Vim sets the 'shellcmdflag' and 'shellquote' or | |
302 'shellxquote' options will be set as described above. | |
303 | |
14421 | 304 vim:tw=78:ts=8:noet:ft=help:norl: |