Mirror of the Vim source from https://github.com/vim/vim
Revision | f55897d6921d622ac2649e4c94ddb38d121c2832 (tree) |
---|---|
Zeit | 2004-12-30 06:03:02 |
Autor | vimboss |
Commiter | vimboss |
updated for version 7.0026
@@ -1,4 +1,4 @@ | ||
1 | -*quickfix.txt* For Vim version 7.0aa. Last change: 2004 Dec 27 | |
1 | +*quickfix.txt* For Vim version 7.0aa. Last change: 2004 Dec 28 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -281,10 +281,13 @@ | ||
281 | 281 | powerful Vim search patterns. An external grep program can be used when the |
282 | 282 | Vim grep does not do what you want. |
283 | 283 | |
284 | -The internal method may be a bit slower, because files are read into memory. | |
285 | -The advantage is that line separators and encoding are automatically | |
286 | -recognized, as if a file is being edited. And multi-line patterns can be | |
287 | -used. | |
284 | +The internal method will be slower, because files are read into memory. The | |
285 | +advantages are: | |
286 | +- Line separators and encoding are automatically recognized, as if a file is | |
287 | + being edited. | |
288 | +- Uses Vim search patterns. Multi-line patterns can be used. | |
289 | +- When plugins are enabled: compressed and remote files can be searched. | |
290 | + |gzip| |netrw| | |
288 | 291 | |
289 | 292 | |
290 | 293 | 5.1 using Vim's internal grep |
@@ -294,11 +297,22 @@ | ||
294 | 297 | Search for {pattern} in the files {file} ... and set |
295 | 298 | the error list to the matches. |
296 | 299 | {pattern} if a Vim search pattern. Instead of |
297 | - enclosing it in / any character can be used, so long | |
298 | - as it does not appear in {pattern}. | |
300 | + enclosing it in / any non-ID character |'isident'| | |
301 | + can be used, so long as it does not appear in | |
302 | + {pattern}. | |
303 | + Examples: > | |
304 | + :vimgrep /an error/ *.c | |
305 | + :vimgrep /\<FileName\>/ *.h include/* | |
299 | 306 | |
307 | +:vim[grep][!] {pattern} {file} ... | |
308 | + Like above, but instead of enclosing the pattern in a | |
309 | + non-ID character use a white-separated pattern. The | |
310 | + pattern must start with an ID character. | |
311 | + Example: > | |
312 | + :vimgrep Error *.c | |
313 | +< | |
300 | 314 | *:vimgrepa* *:vimgrepadd* |
301 | -:vimgrepa[dd][!] /{pattern}/ {file} ... | |
315 | +:vimgrepa[dd][!] [/]{pattern}[/] {file} ... | |
302 | 316 | Just like ":vimgrep", but instead of making a new list |
303 | 317 | of errors the matches are appended to the current |
304 | 318 | list. |
@@ -1,4 +1,4 @@ | ||
1 | -*starting.txt* For Vim version 7.0aa. Last change: 2004 Jul 13 | |
1 | +*starting.txt* For Vim version 7.0aa. Last change: 2004 Dec 29 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -423,8 +423,8 @@ | ||
423 | 423 | *-U* *E230* |
424 | 424 | -U {gvimrc} The file "gvimrc" is read for initializations when the GUI |
425 | 425 | starts. Other GUI initializations are skipped. When {gvimrc} |
426 | - is equal to "NONE", no file is read for initializations at | |
427 | - all. | |
426 | + is equal to "NONE", no file is read for GUI initializations at | |
427 | + all. |gui-init| | |
428 | 428 | Exception: Reading the system-wide menu file is always done. |
429 | 429 | {not in Vi} |
430 | 430 |
@@ -1,4 +1,4 @@ | ||
1 | -*todo.txt* For Vim version 7.0aa. Last change: 2004 Dec 27 | |
1 | +*todo.txt* For Vim version 7.0aa. Last change: 2004 Dec 29 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -30,48 +30,37 @@ | ||
30 | 30 | *known-bugs* |
31 | 31 | -------------------- Known bugs and current work ----------------------- |
32 | 32 | |
33 | -Python 2.4 breaks uploading with rsync, 2.3 is OK. | |
34 | - | |
35 | -- Use a builtin grep command for ":grep"? Makes it possible to add the | |
36 | - column number. | |
37 | - Patch from Yegappan Lakshmanan, Nov 4. | |
38 | -Don't expand wildcards in pattern (first arg) | |
39 | -completion for all files after first arg. | |
40 | -Use a buffer to load the file, so that gzip files can be searched and long | |
41 | -lines work. | |
42 | - | |
43 | -Patch for mch_FullName() also in Vim 6.3? os_mswin.c | |
33 | +Go through patches from Martin Dalecki. /tmp/dalecki/README | |
44 | 34 | |
45 | -Win32: "gvim -V100" should use dialog with scrollbar. Using | |
46 | -gui_mch_dialog() would be good, but need to move display_errors() to after | |
47 | -creating the window, so that s_hwnd is valid. | |
48 | -How to add a scrollbar to the dialog? | |
35 | +Awaiting response: | |
36 | +- Patch for mch_FullName() also in Vim 6.3? os_mswin.c | |
37 | +- Win32: "gvim -V100" should use dialog with scrollbar. Using | |
38 | + gui_mch_dialog() would be good, but need to move display_errors() to after | |
39 | + creating the window, so that s_hwnd is valid. | |
40 | + How to add a scrollbar to the dialog? | |
41 | +- Win32: tearoff menu window should have a scrollbar when it's taller than | |
42 | + the screen. | |
43 | +- Included NetBeans patches (Gordon Prieur, Oct 20) | |
44 | + See two messages for list of changed files. Additionally: | |
45 | + doc/eval.txt | |
46 | + Docs for message E680. | |
47 | + Docs for ":nbkey". | |
48 | + Asked Gordon to send the differences again, some parts apparently are | |
49 | + missing. | |
50 | +- Browsefilter support for KDE. (Dan Sharp, 2004 July) | |
51 | +- Better configure check for KDE include files from Dan Sharp. | |
49 | 52 | |
50 | -Win32: tearoff menu window should have a scrollbar when it's taller than the | |
51 | -screen. | |
52 | - | |
53 | -Included NetBeans patches (Gordon Prieur, Oct 20) | |
54 | - See two messages for list of changed files. Additionally: | |
55 | - doc/eval.txt | |
56 | - Docs for message E680. | |
57 | - Docs for ":nbkey". | |
58 | - Asked Gordon to send the differences again, some parts apparently are | |
59 | - missing. | |
60 | 53 | |
61 | 54 | PLANNED FOR VERSION 7.0: |
62 | 55 | |
63 | -- Drop the kvim support? There is no maintenance and "yzis" is supposed to | |
64 | - replace it. | |
65 | -- In the kvim/KDE source files fix the formatting. | |
66 | -- KDE version is called "kvim". Make it "gvim", like the others? | |
67 | -- Better configure check for KDE include files from Dan Sharp. | |
68 | -- KDE GUI Input method patch. (Yasuhiro Matsumoto) (upd. Oct 25 2004) | |
69 | - | |
70 | -After including patches: | |
71 | 56 | - For string variables, use length instead of NUL termination? |
72 | 57 | + can include NUL characters |
73 | 58 | - setline() will have problems with NL vs NUL. |
74 | -- new DATA TYPES: lists, dictionaries and function references. | |
59 | +- new DATA TYPES: | |
60 | + - None? (or use empty string?) | |
61 | + - list | |
62 | + - dictionary | |
63 | + - function reference | |
75 | 64 | Check old patch from Robert Webb for array support. |
76 | 65 | Add type checking? See ~/vim/ideas.txt. |
77 | 66 | - Add SPELLCHECKER, with easy to add support for many languages. |
@@ -427,8 +416,9 @@ | ||
427 | 416 | 7 DND doesn't work with KDE (also with GTK 1). |
428 | 417 | |
429 | 418 | KDE GUI known bugs: |
430 | -- The default font is ugly. bold text isn't displayed correctly. | |
431 | - (bold characters are half the width of normal characters) | |
419 | +- There is no active maintenance and "yzis" is supposed to replace it. | |
420 | +- With the default 'guifont' value bold text differs in size from normal | |
421 | + text, causing the display to be messed up. | |
432 | 422 | - Error messages when starting up. The "tip of the day" box is empty. |
433 | 423 | - Encoding of menu items needs to be converted. (Yasuhiro Matsumoto) |
434 | 424 |
@@ -1,4 +1,4 @@ | ||
1 | -*usr_05.txt* For Vim version 7.0aa. Last change: 2004 Aug 27 | |
1 | +*usr_05.txt* For Vim version 7.0aa. Last change: 2004 Dec 29 | |
2 | 2 | |
3 | 3 | VIM USER MANUAL - by Bram Moolenaar |
4 | 4 |
@@ -150,12 +150,11 @@ | ||
150 | 150 | will not need it. |
151 | 151 | |
152 | 152 | > |
153 | - vnoremap p <Esc>:let current_reg = @"<CR>gvs<C-R>=current_reg<CR><Esc> | |
153 | + vnoremap _g y:exe "grep /" . escape(@", '\\/') . "/ *.c *.h"<CR> | |
154 | 154 | |
155 | -This is a complicated mapping. It will not be explained how it works here. | |
156 | -What it does is to make "p" in Visual mode overwrite the selected text with | |
157 | -the previously yanked text. You can see that mappings can be used to do quite | |
158 | -complicated things. Still, it is just a sequence of commands that are | |
155 | +This mapping yanks the visually selected text and searches for it in C files. | |
156 | +This is a complicated mapping. You can see that mappings can be used to do | |
157 | +quite complicated things. Still, it is just a sequence of commands that are | |
159 | 158 | executed like you typed them. |
160 | 159 | |
161 | 160 | > |
@@ -1,4 +1,4 @@ | ||
1 | -*usr_12.txt* For Vim version 7.0aa. Last change: 2004 May 01 | |
1 | +*usr_12.txt* For Vim version 7.0aa. Last change: 2004 Dec 29 | |
2 | 2 | |
3 | 3 | VIM USER MANUAL - by Bram Moolenaar |
4 | 4 |
@@ -345,7 +345,7 @@ | ||
345 | 345 | This causes Vim to search for the string "error_string" in all the specified |
346 | 346 | files (*.c). The editor will now open the first file where a match is found |
347 | 347 | and position the cursor on the first matching line. To go to the next |
348 | -matching line (no matter in what it is file), use the ":cnext" command. To go | |
348 | +matching line (no matter in what file it is), use the ":cnext" command. To go | |
349 | 349 | to the previous match, use the ":cprev" command. Use ":clist" to see all the |
350 | 350 | matches and where they are. |
351 | 351 | The ":grep" command uses the external commands grep (on Unix) or findstr |
@@ -1,4 +1,4 @@ | ||
1 | -*version7.txt* For Vim version 7.0aa. Last change: 2004 Dec 24 | |
1 | +*version7.txt* For Vim version 7.0aa. Last change: 2004 Dec 28 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -20,6 +20,7 @@ | ||
20 | 20 | New data types |new-data-types| |
21 | 21 | KDE support |new-KDE| |
22 | 22 | Translated manual pages |new-manpage-trans| |
23 | +Internal grep |new-vimgrep| | |
23 | 24 | Various new items |new-items-7| |
24 | 25 | |
25 | 26 | IMPROVEMENTS |improvements-7| |
@@ -133,6 +134,16 @@ | ||
133 | 134 | The Unix Makefile installs the Italian manual pages in .../man/it/man1/. |
134 | 135 | |
135 | 136 | |
137 | +Internal grep *new-vimgrep* | |
138 | +------------- | |
139 | + | |
140 | +The ":vimgrep" command can be used to search for a pattern in a list of files. | |
141 | +This is like the ":grep" command, but no external program is used. Besides | |
142 | +better portability, handling of different file encodings and using multi-line | |
143 | +patterns, this also allows grepping in compressed and remote files. | |
144 | +|:vimgrep|. | |
145 | + | |
146 | + | |
136 | 147 | Various new items *new-items-7* |
137 | 148 | ----------------- |
138 | 149 |
@@ -3427,25 +3427,12 @@ | ||
3427 | 3427 | VAR avar; |
3428 | 3428 | { |
3429 | 3429 | buf_T *buf = NULL; |
3430 | - char_u *name; | |
3431 | 3430 | |
3432 | 3431 | if (avar->var_type == VAR_NUMBER) |
3433 | 3432 | buf = buflist_findnr((int)avar->var_val.var_number); |
3434 | 3433 | else if (avar->var_val.var_string != NULL) |
3435 | 3434 | { |
3436 | - /* First make the name into a full path name */ | |
3437 | - name = FullName_save(avar->var_val.var_string, | |
3438 | -#ifdef UNIX | |
3439 | - TRUE /* force expansion, get rid of symbolic links */ | |
3440 | -#else | |
3441 | - FALSE | |
3442 | -#endif | |
3443 | - ); | |
3444 | - if (name != NULL) | |
3445 | - { | |
3446 | - buf = buflist_findname(name); | |
3447 | - vim_free(name); | |
3448 | - } | |
3435 | + buf = buflist_findname_exp(avar->var_val.var_string); | |
3449 | 3436 | if (buf == NULL) |
3450 | 3437 | { |
3451 | 3438 | /* No full path name match, try a match with a URL or a "nofile" |
@@ -141,7 +141,8 @@ | ||
141 | 141 | int full_path = FALSE; |
142 | 142 | #endif |
143 | 143 | #ifdef FEAT_CLIENTSERVER |
144 | - char_u *serverStr = NULL; | |
144 | + char_u *serverStr = NULL; /* remote server command */ | |
145 | + char_u *serverStrEnc = NULL; /* encoding of serverStr */ | |
145 | 146 | char_u *serverName_arg = NULL; /* cmdline arg for server name */ |
146 | 147 | int serverArg = FALSE; /* TRUE when argument for a server */ |
147 | 148 | char_u *servername = NULL; /* allocated name for our server */ |
@@ -378,10 +379,16 @@ | ||
378 | 379 | |
379 | 380 | /* |
380 | 381 | * When a command server argument was found, execute it. This may |
381 | - * exit Vim when it was successful. | |
382 | + * exit Vim when it was successful. Otherwise it's executed further | |
383 | + * on. Remember the encoding used here in "serverStrEnc". | |
382 | 384 | */ |
383 | 385 | if (serverArg) |
386 | + { | |
384 | 387 | cmdsrv_main(&argc, argv, serverName_arg, &serverStr); |
388 | +# ifdef FEAT_MBYTE | |
389 | + serverStrEnc = vim_strsave(p_enc); | |
390 | +# endif | |
391 | + } | |
385 | 392 | |
386 | 393 | /* If we're still running, get the name to register ourselves. |
387 | 394 | * On Win32 can register right now, for X11 need to setup the |
@@ -1662,7 +1669,10 @@ | ||
1662 | 1669 | * else we would have exited above). |
1663 | 1670 | */ |
1664 | 1671 | if (serverStr != NULL) |
1665 | - server_to_input_buf(serverStr); | |
1672 | + { | |
1673 | + server_to_input_buf(serverConvert(serverStrEnc, serverStr, &p)); | |
1674 | + vim_free(p); | |
1675 | + } | |
1666 | 1676 | #endif |
1667 | 1677 | |
1668 | 1678 | /* |
@@ -425,7 +425,8 @@ | ||
425 | 425 | { |
426 | 426 | if (*dirp == NUL) /* tried all directories, fail */ |
427 | 427 | break; |
428 | - fname = findswapname(buf, &dirp, mfp->mf_fname); /* alloc's fname */ | |
428 | + fname = findswapname(buf, &dirp, mfp->mf_fname); | |
429 | + /* alloc's fname */ | |
429 | 430 | if (fname == NULL) /* no file name found for this dir */ |
430 | 431 | continue; |
431 | 432 |
@@ -529,7 +530,7 @@ | ||
529 | 530 | /* There is a small chance that between chosing the swap file name and |
530 | 531 | * creating it, another Vim creates the file. In that case the |
531 | 532 | * creation will fail and we will use another directory. */ |
532 | - fname = findswapname(buf, &dirp, NULL); /* allocates fname */ | |
533 | + fname = findswapname(buf, &dirp, NULL); /* allocates fname */ | |
533 | 534 | if (fname == NULL) |
534 | 535 | continue; |
535 | 536 | if (mf_open_file(mfp, fname) == OK) /* consumes fname! */ |
@@ -3731,7 +3732,8 @@ | ||
3731 | 3732 | * viewing a help file or when the path of the file is different |
3732 | 3733 | * (happens when all .swp files are in one directory). |
3733 | 3734 | */ |
3734 | - if (!recoverymode && buf->b_fname != NULL && !buf->b_help) | |
3735 | + if (!recoverymode && buf->b_fname != NULL | |
3736 | + && !buf->b_help && !(buf->b_flags & BF_DUMMY)) | |
3735 | 3737 | { |
3736 | 3738 | int fd; |
3737 | 3739 | struct block0 b0; |
@@ -13,7 +13,7 @@ | ||
13 | 13 | int bt_dontwrite __ARGS((buf_T *buf)); |
14 | 14 | int bt_dontwrite_msg __ARGS((buf_T *buf)); |
15 | 15 | int buf_hide __ARGS((buf_T *buf)); |
16 | -int grep_internal __ARGS((exarg_T *eap)); | |
16 | +int grep_internal __ARGS((cmdidx_T cmdidx)); | |
17 | 17 | void ex_make __ARGS((exarg_T *eap)); |
18 | 18 | void ex_cc __ARGS((exarg_T *eap)); |
19 | 19 | void ex_cnext __ARGS((exarg_T *eap)); |