1
0
forked from aniani/vim

updated for version 7.0026

This commit is contained in:
Bram Moolenaar 2004-12-29 21:03:02 +00:00
parent 81695250ef
commit 8fc061c7f7
10 changed files with 91 additions and 78 deletions

View File

@ -1,4 +1,4 @@
*quickfix.txt* For Vim version 7.0aa. Last change: 2004 Dec 27 *quickfix.txt* For Vim version 7.0aa. Last change: 2004 Dec 28
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -281,10 +281,13 @@ advantage of the internal grep is that it works on all systems and uses the
powerful Vim search patterns. An external grep program can be used when the powerful Vim search patterns. An external grep program can be used when the
Vim grep does not do what you want. Vim grep does not do what you want.
The internal method may be a bit slower, because files are read into memory. The internal method will be slower, because files are read into memory. The
The advantage is that line separators and encoding are automatically advantages are:
recognized, as if a file is being edited. And multi-line patterns can be - Line separators and encoding are automatically recognized, as if a file is
used. being edited.
- Uses Vim search patterns. Multi-line patterns can be used.
- When plugins are enabled: compressed and remote files can be searched.
|gzip| |netrw|
5.1 using Vim's internal grep 5.1 using Vim's internal grep
@ -294,11 +297,22 @@ used.
Search for {pattern} in the files {file} ... and set Search for {pattern} in the files {file} ... and set
the error list to the matches. the error list to the matches.
{pattern} if a Vim search pattern. Instead of {pattern} if a Vim search pattern. Instead of
enclosing it in / any character can be used, so long enclosing it in / any non-ID character |'isident'|
as it does not appear in {pattern}. can be used, so long as it does not appear in
{pattern}.
Examples: >
:vimgrep /an error/ *.c
:vimgrep /\<FileName\>/ *.h include/*
:vim[grep][!] {pattern} {file} ...
Like above, but instead of enclosing the pattern in a
non-ID character use a white-separated pattern. The
pattern must start with an ID character.
Example: >
:vimgrep Error *.c
<
*:vimgrepa* *:vimgrepadd* *:vimgrepa* *:vimgrepadd*
:vimgrepa[dd][!] /{pattern}/ {file} ... :vimgrepa[dd][!] [/]{pattern}[/] {file} ...
Just like ":vimgrep", but instead of making a new list Just like ":vimgrep", but instead of making a new list
of errors the matches are appended to the current of errors the matches are appended to the current
list. list.

View File

@ -1,4 +1,4 @@
*starting.txt* For Vim version 7.0aa. Last change: 2004 Jul 13 *starting.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -423,8 +423,8 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
*-U* *E230* *-U* *E230*
-U {gvimrc} The file "gvimrc" is read for initializations when the GUI -U {gvimrc} The file "gvimrc" is read for initializations when the GUI
starts. Other GUI initializations are skipped. When {gvimrc} starts. Other GUI initializations are skipped. When {gvimrc}
is equal to "NONE", no file is read for initializations at is equal to "NONE", no file is read for GUI initializations at
all. all. |gui-init|
Exception: Reading the system-wide menu file is always done. Exception: Reading the system-wide menu file is always done.
{not in Vi} {not in Vi}

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.0aa. Last change: 2004 Dec 27 *todo.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -30,48 +30,37 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
*known-bugs* *known-bugs*
-------------------- Known bugs and current work ----------------------- -------------------- Known bugs and current work -----------------------
Python 2.4 breaks uploading with rsync, 2.3 is OK. Go through patches from Martin Dalecki. /tmp/dalecki/README
- Use a builtin grep command for ":grep"? Makes it possible to add the Awaiting response:
column number. - Patch for mch_FullName() also in Vim 6.3? os_mswin.c
Patch from Yegappan Lakshmanan, Nov 4. - Win32: "gvim -V100" should use dialog with scrollbar. Using
Don't expand wildcards in pattern (first arg) gui_mch_dialog() would be good, but need to move display_errors() to after
completion for all files after first arg. creating the window, so that s_hwnd is valid.
Use a buffer to load the file, so that gzip files can be searched and long How to add a scrollbar to the dialog?
lines work. - Win32: tearoff menu window should have a scrollbar when it's taller than
the screen.
- Included NetBeans patches (Gordon Prieur, Oct 20)
See two messages for list of changed files. Additionally:
doc/eval.txt
Docs for message E680.
Docs for ":nbkey".
Asked Gordon to send the differences again, some parts apparently are
missing.
- Browsefilter support for KDE. (Dan Sharp, 2004 July)
- Better configure check for KDE include files from Dan Sharp.
Patch for mch_FullName() also in Vim 6.3? os_mswin.c
Win32: "gvim -V100" should use dialog with scrollbar. Using
gui_mch_dialog() would be good, but need to move display_errors() to after
creating the window, so that s_hwnd is valid.
How to add a scrollbar to the dialog?
Win32: tearoff menu window should have a scrollbar when it's taller than the
screen.
Included NetBeans patches (Gordon Prieur, Oct 20)
See two messages for list of changed files. Additionally:
doc/eval.txt
Docs for message E680.
Docs for ":nbkey".
Asked Gordon to send the differences again, some parts apparently are
missing.
PLANNED FOR VERSION 7.0: PLANNED FOR VERSION 7.0:
- Drop the kvim support? There is no maintenance and "yzis" is supposed to
replace it.
- In the kvim/KDE source files fix the formatting.
- KDE version is called "kvim". Make it "gvim", like the others?
- Better configure check for KDE include files from Dan Sharp.
- KDE GUI Input method patch. (Yasuhiro Matsumoto) (upd. Oct 25 2004)
After including patches:
- For string variables, use length instead of NUL termination? - For string variables, use length instead of NUL termination?
+ can include NUL characters + can include NUL characters
- setline() will have problems with NL vs NUL. - setline() will have problems with NL vs NUL.
- new DATA TYPES: lists, dictionaries and function references. - new DATA TYPES:
- None? (or use empty string?)
- list
- dictionary
- function reference
Check old patch from Robert Webb for array support. Check old patch from Robert Webb for array support.
Add type checking? See ~/vim/ideas.txt. Add type checking? See ~/vim/ideas.txt.
- Add SPELLCHECKER, with easy to add support for many languages. - Add SPELLCHECKER, with easy to add support for many languages.
@ -427,8 +416,9 @@ GTK+ GUI known bugs:
7 DND doesn't work with KDE (also with GTK 1). 7 DND doesn't work with KDE (also with GTK 1).
KDE GUI known bugs: KDE GUI known bugs:
- The default font is ugly. bold text isn't displayed correctly. - There is no active maintenance and "yzis" is supposed to replace it.
(bold characters are half the width of normal characters) - With the default 'guifont' value bold text differs in size from normal
text, causing the display to be messed up.
- Error messages when starting up. The "tip of the day" box is empty. - Error messages when starting up. The "tip of the day" box is empty.
- Encoding of menu items needs to be converted. (Yasuhiro Matsumoto) - Encoding of menu items needs to be converted. (Yasuhiro Matsumoto)

View File

@ -1,4 +1,4 @@
*usr_05.txt* For Vim version 7.0aa. Last change: 2004 Aug 27 *usr_05.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar
@ -150,12 +150,11 @@ it worked before Vim 5.0. Otherwise the "Q" command starts Ex mode, but you
will not need it. will not need it.
> >
vnoremap p <Esc>:let current_reg = @"<CR>gvs<C-R>=current_reg<CR><Esc> vnoremap _g y:exe "grep /" . escape(@", '\\/') . "/ *.c *.h"<CR>
This is a complicated mapping. It will not be explained how it works here. This mapping yanks the visually selected text and searches for it in C files.
What it does is to make "p" in Visual mode overwrite the selected text with This is a complicated mapping. You can see that mappings can be used to do
the previously yanked text. You can see that mappings can be used to do quite quite complicated things. Still, it is just a sequence of commands that are
complicated things. Still, it is just a sequence of commands that are
executed like you typed them. executed like you typed them.
> >

View File

@ -1,4 +1,4 @@
*usr_12.txt* For Vim version 7.0aa. Last change: 2004 May 01 *usr_12.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar
@ -345,7 +345,7 @@ program files, for example, enter the following command: >
This causes Vim to search for the string "error_string" in all the specified This causes Vim to search for the string "error_string" in all the specified
files (*.c). The editor will now open the first file where a match is found files (*.c). The editor will now open the first file where a match is found
and position the cursor on the first matching line. To go to the next and position the cursor on the first matching line. To go to the next
matching line (no matter in what it is file), use the ":cnext" command. To go matching line (no matter in what file it is), use the ":cnext" command. To go
to the previous match, use the ":cprev" command. Use ":clist" to see all the to the previous match, use the ":cprev" command. Use ":clist" to see all the
matches and where they are. matches and where they are.
The ":grep" command uses the external commands grep (on Unix) or findstr The ":grep" command uses the external commands grep (on Unix) or findstr

View File

@ -1,4 +1,4 @@
*version7.txt* For Vim version 7.0aa. Last change: 2004 Dec 24 *version7.txt* For Vim version 7.0aa. Last change: 2004 Dec 28
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -20,6 +20,7 @@ NEW FEATURES |new-7|
New data types |new-data-types| New data types |new-data-types|
KDE support |new-KDE| KDE support |new-KDE|
Translated manual pages |new-manpage-trans| Translated manual pages |new-manpage-trans|
Internal grep |new-vimgrep|
Various new items |new-items-7| Various new items |new-items-7|
IMPROVEMENTS |improvements-7| IMPROVEMENTS |improvements-7|
@ -133,6 +134,16 @@ Italian (translated by Antonio Colombo). More languages will follow.
The Unix Makefile installs the Italian manual pages in .../man/it/man1/. The Unix Makefile installs the Italian manual pages in .../man/it/man1/.
Internal grep *new-vimgrep*
-------------
The ":vimgrep" command can be used to search for a pattern in a list of files.
This is like the ":grep" command, but no external program is used. Besides
better portability, handling of different file encodings and using multi-line
patterns, this also allows grepping in compressed and remote files.
|:vimgrep|.
Various new items *new-items-7* Various new items *new-items-7*
----------------- -----------------

View File

@ -3427,25 +3427,12 @@ find_buffer(avar)
VAR avar; VAR avar;
{ {
buf_T *buf = NULL; buf_T *buf = NULL;
char_u *name;
if (avar->var_type == VAR_NUMBER) if (avar->var_type == VAR_NUMBER)
buf = buflist_findnr((int)avar->var_val.var_number); buf = buflist_findnr((int)avar->var_val.var_number);
else if (avar->var_val.var_string != NULL) else if (avar->var_val.var_string != NULL)
{ {
/* First make the name into a full path name */ buf = buflist_findname_exp(avar->var_val.var_string);
name = FullName_save(avar->var_val.var_string,
#ifdef UNIX
TRUE /* force expansion, get rid of symbolic links */
#else
FALSE
#endif
);
if (name != NULL)
{
buf = buflist_findname(name);
vim_free(name);
}
if (buf == NULL) if (buf == NULL)
{ {
/* No full path name match, try a match with a URL or a "nofile" /* No full path name match, try a match with a URL or a "nofile"

View File

@ -141,7 +141,8 @@ main
int full_path = FALSE; int full_path = FALSE;
#endif #endif
#ifdef FEAT_CLIENTSERVER #ifdef FEAT_CLIENTSERVER
char_u *serverStr = NULL; char_u *serverStr = NULL; /* remote server command */
char_u *serverStrEnc = NULL; /* encoding of serverStr */
char_u *serverName_arg = NULL; /* cmdline arg for server name */ char_u *serverName_arg = NULL; /* cmdline arg for server name */
int serverArg = FALSE; /* TRUE when argument for a server */ int serverArg = FALSE; /* TRUE when argument for a server */
char_u *servername = NULL; /* allocated name for our server */ char_u *servername = NULL; /* allocated name for our server */
@ -378,10 +379,16 @@ main
/* /*
* When a command server argument was found, execute it. This may * When a command server argument was found, execute it. This may
* exit Vim when it was successful. * exit Vim when it was successful. Otherwise it's executed further
* on. Remember the encoding used here in "serverStrEnc".
*/ */
if (serverArg) if (serverArg)
{
cmdsrv_main(&argc, argv, serverName_arg, &serverStr); cmdsrv_main(&argc, argv, serverName_arg, &serverStr);
# ifdef FEAT_MBYTE
serverStrEnc = vim_strsave(p_enc);
# endif
}
/* If we're still running, get the name to register ourselves. /* If we're still running, get the name to register ourselves.
* On Win32 can register right now, for X11 need to setup the * On Win32 can register right now, for X11 need to setup the
@ -1662,7 +1669,10 @@ scripterror:
* else we would have exited above). * else we would have exited above).
*/ */
if (serverStr != NULL) if (serverStr != NULL)
server_to_input_buf(serverStr); {
server_to_input_buf(serverConvert(serverStrEnc, serverStr, &p));
vim_free(p);
}
#endif #endif
/* /*

View File

@ -425,7 +425,8 @@ ml_setname(buf)
{ {
if (*dirp == NUL) /* tried all directories, fail */ if (*dirp == NUL) /* tried all directories, fail */
break; break;
fname = findswapname(buf, &dirp, mfp->mf_fname); /* alloc's fname */ fname = findswapname(buf, &dirp, mfp->mf_fname);
/* alloc's fname */
if (fname == NULL) /* no file name found for this dir */ if (fname == NULL) /* no file name found for this dir */
continue; continue;
@ -529,7 +530,7 @@ ml_open_file(buf)
/* There is a small chance that between chosing the swap file name and /* There is a small chance that between chosing the swap file name and
* creating it, another Vim creates the file. In that case the * creating it, another Vim creates the file. In that case the
* creation will fail and we will use another directory. */ * creation will fail and we will use another directory. */
fname = findswapname(buf, &dirp, NULL); /* allocates fname */ fname = findswapname(buf, &dirp, NULL); /* allocates fname */
if (fname == NULL) if (fname == NULL)
continue; continue;
if (mf_open_file(mfp, fname) == OK) /* consumes fname! */ if (mf_open_file(mfp, fname) == OK) /* consumes fname! */
@ -3731,7 +3732,8 @@ findswapname(buf, dirp, old_fname)
* viewing a help file or when the path of the file is different * viewing a help file or when the path of the file is different
* (happens when all .swp files are in one directory). * (happens when all .swp files are in one directory).
*/ */
if (!recoverymode && buf->b_fname != NULL && !buf->b_help) if (!recoverymode && buf->b_fname != NULL
&& !buf->b_help && !(buf->b_flags & BF_DUMMY))
{ {
int fd; int fd;
struct block0 b0; struct block0 b0;

View File

@ -13,7 +13,7 @@ int bt_nofile __ARGS((buf_T *buf));
int bt_dontwrite __ARGS((buf_T *buf)); int bt_dontwrite __ARGS((buf_T *buf));
int bt_dontwrite_msg __ARGS((buf_T *buf)); int bt_dontwrite_msg __ARGS((buf_T *buf));
int buf_hide __ARGS((buf_T *buf)); int buf_hide __ARGS((buf_T *buf));
int grep_internal __ARGS((exarg_T *eap)); int grep_internal __ARGS((cmdidx_T cmdidx));
void ex_make __ARGS((exarg_T *eap)); void ex_make __ARGS((exarg_T *eap));
void ex_cc __ARGS((exarg_T *eap)); void ex_cc __ARGS((exarg_T *eap));
void ex_cnext __ARGS((exarg_T *eap)); void ex_cnext __ARGS((exarg_T *eap));