Movatterモバイル変換
[0]ホーム
The Wayback Machine - https://web.archive.org/web/20200729064505/http://vimdoc.sourceforge.net/htmldoc/tagsrch.html
Vim documentation: tagsrch
main help file
*tagsrch.txt* For Vim version 7.3. Last change: 2009 Feb 18 VIM REFERENCE MANUAL byBramMoolenaarTags and special searches*tags-and-searches*See section |29.1| of the user manual for an introduction.1. Jump to a tag|tag-commands|2. Tag stack|tag-stack|3. Tag match list|tag-matchlist|4. Tags details|tag-details|5. Tags file format|tags-file-format|6. Include file searches|include-search|==============================================================================1. Jump to atag*tag-commands**tag* *tags*Atag is an identifier that appears in a "tags" file. It is a sort of labelthat can be jumped to. For example: In C programs each function name can beusedas atag. The "tags" file has to be generated by a program likectags,before thetag commands can be used.With the ":tag" command the cursor will be positioned on thetag. With theCTRL-] command, the keyword on which the cursor is standing is usedas thetag. If the cursor is not on a keyword, the first keyword to the right of thecursor is used.The ":tag" command works very well for C programs. If you see a call to afunction and wonder what that function does, position the cursor inside of thefunction name and hitCTRL-]. This will bring you to the function definition.Aneasy way back is with theCTRL-T command. Also read about thetag stackbelow.*:ta* *:tag* *E426* *E429*:[count]ta[g][!] {ident}Jump to the definition of {ident}, using theinformation in thetags file(s). Put {ident} in thetag stack. See |tag-!| for [!].{ident} can be a regexppattern, see |tag-regexp|.When there are several matchingtags for {ident}, jumpto the[count] one. When[count] is omitted thefirst one is jumped to. See |tag-matchlist| forjumping to other matchingtags.g<LeftMouse>*g<LeftMouse>*<C-LeftMouse>*<C-LeftMouse>* *CTRL-]*CTRL-]Jump to the definition of the keyword under thecursor. Sameas ":tag {ident}", where {ident} is thekeyword under or after cursor.When there are several matchingtags for {ident}, jumpto the[count] one. When no[count] is given thefirst one is jumped to. See |tag-matchlist| forjumping to other matchingtags.{Vi: identifier after the cursor}*v_CTRL-]*{Visual}CTRL-]Sameas ":tag {ident}", where {ident} is the text thatis highlighted. {not in Vi}*telnet-CTRL-]*CTRL-] is the default telnetescape key. When you typeCTRL-] to jump to atag, you will get the telnet prompt instead. Most versions of telnet allowchanging or disabling the defaultescape key. See the telnet man page. Youcan 'telnet-E {Hostname}' to disable theescape character, or 'telnet-e{EscapeCharacter} {Hostname}' to specify anotherescape character. Ifpossible, try to use "ssh" instead of "telnet" to avoid this problem.*tag-priority*When there are multiple matches for atag, this priority is used:1. "FSC" A full matching statictag for the current file.2. "F C" A full matching globaltag for the current file.3. "F " A full matching globaltag for another file.4. "FS " A full matching statictag for another file.5. " SC" An ignore-case matching statictag for the current file.6. " C" An ignore-case matching globaltag for the current file.7. " " An ignore-case matching globaltag for another file.8. "S " An ignore-case matching statictag for another file.Note that when the current file changes, the priority list is mostly notchanged, to avoid confusion when using ":tnext". It is changed when using":tag {ident}".The ignore-case matches are not found for a ":tag" command when the'ignorecase' option is off. They are found when apattern is used (startingwith a "/") and for ":tselect", also when'ignorecase' is off. Note thatusing ignore-casetag searching disables binary searching in thetags file,which causes a slowdown. This can be avoided by fold-casesorting thetagfile. See the'tagbsearch' option for an explanation.==============================================================================2. Tag stack*tag-stack* *tagstack* *E425*On thetag stack is remembered whichtags you jumped to, and from where.Tags are only pushed onto the stack when the'tagstack' option is set.g<RightMouse>*g<RightMouse>*<C-RightMouse>*<C-RightMouse>* *CTRL-T*CTRL-TJump to[count] older entry in thetag stack(default 1). {not in Vi}*:po* *:pop* *E555* *E556*:[count]po[p][!]Jump to[count] older entry intag stack (default 1).See |tag-!| for [!]. {not in Vi}:[count]ta[g][!]Jump to[count] newer entry intag stack (default 1).See |tag-!| for [!]. {not in Vi}*:tags*:tagsShow the contents of thetag stack. The activeentry is marked with a '>'. {not in Vi}The output of ":tags" looks like this: # TOtag FROM line in file/text 1 1 main 1 harddisk2:text/vim/test> 2 2 FuncA58i = FuncA(10); 3 1 FuncC 357 harddisk2:text/vim/src/amiga.cThis list shows thetags that you jumped to and the cursor position beforethat jump. The oldertags are at the top, the newer at the bottom.The '>' points to the active entry. This is thetag that will be used by thenext ":tag" command. TheCTRL-T and ":pop" command will use the positionabove the active entry.Below the "TO" is the number of the current match in the match list. Notethat this doesn't change when using ":pop" or ":tag".The line number and file name are remembered to be able to get back to whereyou were before thetag command. The line number will be correct, also whendeleting/inserting lines, unless this was done by another program (e.g.another instance of Vim).For the current file, the "file/text" column shows the text at the position.An indent is removed and a long line is truncated to fit in thewindow.You can jump to previously usedtags with several commands. Some examples:":pop" orCTRL-Tto position before previoustag{count}CTRL-Tto position before {count} oldertag":tag"to newertag":0tag"to last usedtagThe most obvious way to use this is while browsing through the call graph ofa program. Consider the following call graph:main ---> FuncA ---> FuncC ---> FuncB(Explanation: main calls FuncA and FuncB; FuncA calls FuncC).You can get from main to FuncA by usingCTRL-] on the call to FuncA. Thenyou canCTRL-] to get to FuncC. If you now want to go back to main you canuseCTRL-Ttwice. Then you canCTRL-] to FuncB.If you issue a ":ta {ident}" orCTRL-] command, thistag is inserted at thecurrent position in the stack. If the stack was full (it can hold up to 20entries), the oldest entry is deleted and the older entriesshift oneposition up (their index number is decremented by one). If the last usedentry was not at the bottom, the entries below the last used one aredeleted. This means that an old branch in the call graph is lost. After thecommands explained above thetag stack will look like this: # TOtagFROM line in file/text 1 1 main1 harddisk2:text/vim/test 2 1 FuncB 59 harddisk2:text/vim/src/main.c*E73*When you try to use thetag stack while it doesn't contain anything you willget an error message.==============================================================================3. Tag match list*tag-matchlist* *E427* *E428*When there are several matchingtags, these commands can be used to jumpbetween them. Note that these commands don't change thetag stack, they keepthe same entry.*:ts* *:tselect*:ts[elect][!] [ident]List thetags that match [ident], using theinformation in thetags file(s).When [ident] is not given, the lasttag name from thetag stack is used.With a '>' in the first column is indicated which isthe current position in the list (if there is one).[ident] can be a regexppattern, see |tag-regexp|.See |tag-priority| for the priorities used in thelisting. {not in Vi}Example output: nr pri kind tagfile 1 Ff mch_delayos_amiga.cmch_delay(msec, ignoreinput)> 2 Ff mch_delayos_msdos.cmch_delay(msec, ignoreinput) 3 Ff mch_delayos_unix.cmch_delay(msec, ignoreinput)Enter nr of choice (<CR> to abort): See |tag-priority| for the "pri" column. Note thatthis depends on the current file, thus using":tselect xxx" can produce different results.The "kind" column gives the kind oftag, if this wasincluded in thetags file.The "info" column shows information that could befound in thetags file. It depends on the programthat produced thetags file.When the list is long, you may get the |more-prompt|.If you already see thetag you want to use, you cantype 'q' and enter the number.*:sts* *:stselect*:sts[elect][!] [ident]Does ":tselect[!] [ident]" and splits thewindow forthe selectedtag. {not in Vi}*g]*g]LikeCTRL-], but use ":tselect" instead of ":tag".{not in Vi}*v_g]*{Visual}g]Sameas "g]", but use the highlighted textas theidentifier. {not in Vi}*:tj* *:tjump*:tj[ump][!] [ident]Like ":tselect", but jump to thetag directly whenthere is only one match. {not in Vi}*:stj* *:stjump*:stj[ump][!] [ident]Does ":tjump[!] [ident]" and splits thewindow for theselectedtag. {not in Vi}*g_CTRL-]*gCTRL-]LikeCTRL-], but use ":tjump" instead of ":tag".{not in Vi}*v_g_CTRL-]*{Visual}gCTRL-]Sameas "g CTRL-]", but use the highlighted textasthe identifier. {not in Vi}*:tn* *:tnext*:[count]tn[ext][!]Jump to[count] next matchingtag (default 1). See|tag-!| for [!]. {not in Vi}*:tp* *:tprevious*:[count]tp[revious][!]Jump to[count] previous matchingtag (default 1).See |tag-!| for [!]. {not in Vi}*:tN* *:tNext*:[count]tN[ext][!]Sameas ":tprevious". {not in Vi}*:tr* *:trewind*:[count]tr[ewind][!]Jump to first matchingtag. If[count] is given, jumpto [count]th matching tag. See |tag-!| for [!]. {notin Vi}*:tf* *:tfirst*:[count]tf[irst][!]Sameas ":trewind". {not in Vi}*:tl* *:tlast*:tl[ast][!]Jump to last matching tag. See |tag-!| for [!]. {notin Vi}*:lt* *:ltag*:lt[ag][!] [ident]Jump totag [ident] and add the matchingtags to a newlocation list for the currentwindow. [ident] can bea regexppattern, see |tag-regexp|. When [ident] isnot given, the lasttag name from thetag stack isused. The searchpattern to locate thetag line isprefixed with "\V" toescape all the specialcharacters (very nomagic). The location list showingthe matchingtags is independent of thetag stack.See |tag-!| for [!].{not in Vi}When there is no other message, Vim shows which matchingtag has been jumpedto, and the number of matchingtags:tag 1 of 3 or moreThe " or more" is used to indicate that Vim didn't try all thetags files yet.When using ":tnext" a few times, or with ":tlast", more matches may be found.When you didn't see this message because of some other message, or you justwant to know where you are, this command will show it again (and jump to thesametagas last time)::0tn *tag-skip-file*When a matchingtag is found for which the file doesn't exist, this match isskipped and the next matchingtag is used. Vim reports this, to notify you ofmissing files. When the end of the list of matches has been reached, an errormessage is given.*tag-preview*Thetag match list can also be used in the previewwindow. The commands arethe sameas above, with a "p" prepended.{not available when compiled without the |+quickfix| feature}*:pts* *:ptselect*:pts[elect][!] [ident]Does ":tselect[!] [ident]" and shows the newtag in a"Preview"window. See |:ptag| for more info.{not in Vi}*:ptj* *:ptjump*:ptj[ump][!] [ident]Does ":tjump[!] [ident]" and shows the newtag in a"Preview"window. See |:ptag| for more info.{not in Vi}*:ptn* *:ptnext*:[count]ptn[ext][!]":tnext" in the previewwindow. See |:ptag|.{not in Vi}*:ptp* *:ptprevious*:[count]ptp[revious][!]":tprevious" in the previewwindow. See |:ptag|.{not in Vi}*:ptN* *:ptNext*:[count]ptN[ext][!]Sameas ":ptprevious". {not in Vi}*:ptr* *:ptrewind*:[count]ptr[ewind][!]":trewind" in the previewwindow. See |:ptag|.{not in Vi}*:ptf* *:ptfirst*:[count]ptf[irst][!]Sameas ":ptrewind". {not in Vi}*:ptl* *:ptlast*:ptl[ast][!]":tlast" in the previewwindow. See |:ptag|.{not in Vi}==============================================================================4. Tags details*tag-details**static-tag*A statictag is atag that is defined for a specific file. In a C programthis could be a static function.InVi jumping to atag sets the current searchpattern. This means thatthe "n" command after jumping to atag does not search for the samepatternthat it did before jumping to thetag. Vim does notdo thisas we consider itto be a bug. You can still find thetag searchpattern in the searchhistory.If you really want the oldVi behavior, set the 't' flag in'cpoptions'.*tag-binary-search*Vim uses binary searching in thetags file to find the desiredtag quickly(when enabled at compile time |+tag_binary|). But this only works if thetags file was sorted on ASCII byte value. Therefore, if no match was found,another try is done with a linear search. If you only want the linear search,reset the'tagbsearch' option. Or better: Sort thetags file!Note that the binary searching is disabled when not looking for atag with aspecific name. This happens when ignoringcase and when a regularexpressionis used that doesn't start with a fixed string. Tag searching can be a lotslower then. The former can be avoided by case-foldsorting thetags file.See'tagbsearch' for details.*tag-regexp*The ":tag" and "tselect" commands accept a regularexpression argument. See|pattern| for the special characters that can be used.When the argument starts with '/', it is usedas apattern. If the argumentdoes not start with '/', it is taken literally,as a fulltag name.Examples: :tag main jumps to thetag "main" that has the highest priority. :tag /^get jumps to thetag that starts with "get" and has the highest priority. :tag /norm lists all thetags that contain "norm", including "id_norm".When the argument both exists literally, and match when usedas aregexp, aliteral match has a higher priority. For example, ":tag /open" matches "open"before "open_file" and "file_open".When using apatterncase is ignored. If you want to matchcase use "\C" inthepattern.*tag-!*If thetag is in the current file this will always work. Otherwise theperformed actions depend on whether the current file was changed, whether a !is added to the command and on the'autowrite' option:----------------------------------------------------------------------------- yesxxx gototag no noxx read other file, gototag noyes yesxabandon current file, read other file, gototag noyesno on write current file, read other file, gototag noyesno off fail------------------------------------------------------------------------------ If thetag is in the current file, the command will always work.- If thetag is in another file and the current file was not changed, the other file will be made the current file and read into the buffer.- If thetag is in another file, the current file was changed and a ! is added to the command, the changes to the current file are lost, the other file will be made the current file and read into the buffer.- If thetag is in another file, the current file was changed and the'autowrite' option is on, the current file will be written, the other file will be made the current file and read into the buffer.- If thetag is in another file, the current file was changed and the'autowrite' option is off, the command will fail. If you want to save the changes, use the ":w" command and then use ":tag" without an argument. This works because thetag is put on the stack anyway. If you want to lose the changes you can use the ":tag!" command.*tag-security*Note that Vim forbids some commands, for security reasons. This works likeusing the'secure' option for exrc/vimrc files in the current directory. See|trojan-horse| and |sandbox|.When the {tagaddress} changes a buffer, you will get a warning message:"WARNING:tag command changed a buffer!!!"In a future versionchanging the buffer will be impossible. All this forsecurity reasons: Somebody might hide a nasty command in thetags file, whichwould otherwise go unnoticed. Example::$d|/tag-function-name/{this security prevention is not present in Vi}InVi the ":tag" command sets the last searchpattern when thetag is searchedfor. In Vim this is not done, the previous searchpattern is still remembered,unless the 't' flag is present in'cpoptions'. The searchpattern is alwaysput in the searchhistory, so you can modify it if searching fails.*emacs-tags* *emacs_tags* *E430*Emacs styletag files are only supported if Vim was compiled with the|+emacs_tags| feature enabled. Sorry, there is no explanation about Emacs tagfiles here, it is only supported for backwards compatibility :-).Lines in Emacstags files can be very long. Vim only deals with lines of upto about 510 bytes. To see whether lines are ignored set'verbose' to 5 orhigher.*tags-option*The'tags' option is a list of file names. Each of these files is searchedfor thetag. This can be used to use a differenttags file than the defaultfile "tags". It can also be used to access a commontags file.The next file in the list is not used when:- A matching statictag for the current buffer has been found.- A matching globaltag has been found.This also depends on the'ignorecase' option. If it is off, and thetags fileonly has a match without matchingcase, the nexttags file is searched for amatch with matchingcase. If notag with matchingcase is found, the firstmatch without matchingcase is used. If'ignorecase' is on, and a matchingglobaltag with or without matchingcase is found, this one is used, nofurthertags files are searched.When atag file name starts with "./", the '.' is replaced with the path ofthe current file. This makes it possible to use atags file in the directorywhere the current file is (no matter what the current directory is). The ideaof using "./" is that you can define whichtag file is searched first: In thecurrent directory ("tags,./tags") or in the directory of the current file("./tags,tags").For example::set tags=./tags,tags,/home/user/commontagsIn this example thetag will first be searched for in the file "tags" in thedirectory where the current file is. Next the "tags" file in the currentdirectory. If it is not found there, then the file "/home/user/commontags"will be searched for thetag.This can be switched off by including the 'd' flag in'cpoptions', to makeitVi compatible. "./tags" will then be thetags file in the currentdirectory, instead of thetags file in the directory where the current fileis.Instead of the comma a space may be used. Then abackslash is required forthe space to be included in the string option::set tags=tags\ /home/user/commontagsTo include a space in a file name use three backslashes. To include a commain a file name use two backslashes. For example, use::set tags=tag\\\ file,/home/user/common\\,tagsfor the files "tag file" and "/home/user/common,tags". The'tags' option willhave the value "tag\ file,/home/user/common\,tags".If the'tagrelative' option is on (which is the default) and using atag filein another directory, file names in thattag file are relative to thedirectory where thetag file is.==============================================================================5. Tags file format*tags-file-format* *E431**ctags* *jtags*Atags file can be created with an external command, for example "ctags". Itwill contain atag for each function. Some versions of "ctags" will also makeatag for each "#defined"macro, typedefs, enums, etc.Some programs that generatetags files:ctagsAs found on mostUnix systems. Only supports C. Onlydoes the basic work.*Exuberant_ctags*exuberantctagsThis a very good one. It works for C, C++, Java,Fortran, Eiffel and others. It can generatetags for many items. Seehttp://ctags.sourceforge.net.etagsConnected to Emacs. Supports many languages.JTagsFor Java, in Java. It can be found athttp://www.fleiner.com/jtags/.ptags.pyForPython, inPython. Found in yourPython sourcedirectory at Tools/scripts/ptags.py.ptagsForPerl, inPerl. It can be found athttp://www.eleves.ens.fr:8080/home/nthiery/Tags/. gnatxref For Ada. Seehttp://www.gnuada.org/. gnatxref ispart of the gnat package.The lines in thetags file must have one of these three formats:1. {tagname}{TAB} {tagfile} {TAB} {tagaddress}2. {tagfile}:{tagname} {TAB} {tagfile} {TAB} {tagaddress}3. {tagname}{TAB} {tagfile} {TAB} {tagaddress} {term} {field} ..The first is a normaltag, which is completely compatible withVi. It is theonly format produced by traditionalctags implementations. This is often usedforfunctions that are global, also referenced in other files.The lines in thetags file can end in <LF> or <CR><LF>. On theMacintosh<CR>also works. The<CR> and<NL> characters can never appear inside a line.*tag-old-static*The second format is for a statictag only. It is obsolete now, replaced bythe third format. It is only supported byElvis 1.x and Vim and a fewversions ofctags. A statictag is often used forfunctions that are local,only referenced in the file {tagfile}. Note that for the statictag, the twooccurrences of {tagfile} must be exactly the same. Also see |tags-option|below, for how statictags are used.The third format is new. It includes additional information in optionalfields at the end of each line. It is backwards compatible withVi. It isonly supported by new versions ofctags (suchas Exuberantctags).{tagname}The identifier. Normally the name of a function, but it canbe any identifier. It cannot contain a<Tab>.{TAB}One<Tab> character. Note: previous versions allowed anywhite space here. This has been abandoned to allow spaces in{tagfile}. It can be re-enabled by including the|+tag_any_white| feature at compile time. *tag-any-white*{tagfile}The file that contains the definition of {tagname}. It canhave an absolute or relative path. It may contain environmentvariables andwildcards (although the use ofwildcards isdoubtful). It cannot contain a<Tab>.{tagaddress}TheEx command that positions the cursor on thetag. It canbe anyEx command, although restrictions apply (see|tag-security|).Posix only allows line numbers and searchcommands, which are mostly used.{term};" The two characters semicolon and doublequote. This isinterpreted byVias the start of a comment, which makes thefollowing be ignored. This is for backwards compatibilitywithVi, it ignores the following fields.{field} ..A list of optional fields. Each field has the form:<Tab>{fieldname}:{value}The {fieldname} identifies the field, and can only containalphabetical characters [a-zA-Z].The {value} is any string, but cannot contain a<Tab>.These characters are special:"\t" stands for a<Tab>"\r" stands for a<CR>"\n" stands for a<NL>"\\" stands for a single '\' characterThere is one field that doesn't have a ':'. This is the kindof thetag. It is handled like it was preceded with "kind:".See the documentation ofctags for the kinds it produces.The only other field currently recognized by Vim is "file:"(with an empty value). It is used for a statictag.The first lines in thetags file can contain lines that start with!_TAG_These are sorted to the first lines, only raretags that start with "!" cansort to before them. Vim recognizes two items. The first one is the linethat indicates if the file was sorted. When this line is found, Vim usesbinary searching for thetags file:Atag file may be case-fold sorted to avoid a linear search when'ignorecase'is on. See'tagbsearch' for details. The value '2' should be used then:The othertag that Vim recognizes, but only when compiled with the|+multi_byte| feature, is the encoding of thetags file:Here "utf-8" is the encoding used for thetags. Vim will then convert thetagbeing searched for from'encoding' to the encoding of thetags file. And whenlistingtags the reverse happens. When the conversion fails the unconvertedtag is used.*tag-search*The command can be anyEx command, but often it is a search command.Examples:The command is always executed with'magic' not set. The only specialcharacters in a searchpattern are "^" (begin-of-line) and "$" (<EOL>).See |pattern|. Note that you must put abackslash before eachbackslash inthe search text. This is for backwards compatibility withVi.*E434* *E435*If the command is a normal search command (it starts and ends with "/" or"?"), some special handling is done:- Searching starts on line 1 of the file. The direction of the search is forward for "/", backward for "?". Note that'wrapscan' does not matter, the whole file is always searched. (Vi does use'wrapscan', which causedtags sometimes not be found.) {Vi starts searching in line 2 of another file. It does not find atag in line 1 of another file when'wrapscan' is not set}- If the search fails, another try is done ignoringcase. If that fails too, a search is done for:"^tagname[ \t]*(" (thetag with '^' prepended and "[ \t]*(" appended). When using function names, this will find the function name when it is in column 0. This will help when the arguments to the function have changed since thetags file was made. If this search also fails another search is done with:"^[#a-zA-Z_].*\<tagname[ \t]*(" This means: A line starting with '#' or an identifier and containing thetag followed by white space and a '('. This will findmacro names and function names with a type prepended. {the extra searches are not in Vi}==============================================================================6. Include file searches*include-search* *definition-search**E387* *E388* *E389*These commands look for a string in the current file and in all encounteredincluded files (recursively). This can be used to find the definition of avariable, function ormacro. If you only want to search in the currentbuffer, use the commands listed at |pattern-searches|.These commands are not available when the |+find_in_path| feature was disabledat compile time.When a line is encountered that includes another file, that file is searchedbefore continuing in the current buffer. Files included by included files arealso searched. When an include file could not be found it is silentlyignored. Use the |:checkpath| command to discover which files could not befound, possibly your'path' option is not set up correctly. Note: theincluded file is searched, not a buffer that may be editing that file. Onlyfor the current file the lines in the buffer are used.The string can be any keyword or a definedmacro. For the keyword any matchwill be found. For defined macros only lines that match with the'define'option will be found. The default is "^#\s*define", which is for C programs.For other languages you probably want to change this. See'define' for anexample for C++. The string cannot contain an end-of-line, only matcheswithin a line are found.When a match is found for a definedmacro, the displaying of lines continueswith the next line when a line ends in abackslash.The commands that start with "[" start searching from the start of the currentfile. The commands that start with "]" start at the current cursor position.The'include' option is used to define a line that includes another file. Thedefault is "\^#\s*include", which is for C programs. Note: Vim does notrecognize Csyntax, if the'include' option matches a line inside"#ifdef/#endif" or inside a comment, it is searched anyway. The'isfname'option is used to recognize the file name that comes after the matchedpattern.The'path' option is used to find the directory for the include files thatdo not have an absolute path.The'comments' option is used for the commands that display a single line orjump to a line. It defines patterns that may start a comment. Those linesare ignored for the search, unless [!] is used. One exception: When the linematches thepattern "^# *define" it is not considered to be a comment.If you want to list matches, and then select one to jump to, you could use amapping todo that for you. Here is an example: :map <F4> [I:let nr = input("Which one: ")<Bar>exe "normal " . nr ."[\t"<CR> *[i*[iDisplay the first line that contains the keywordunder the cursor. The search starts at the beginningof the file. Lines that look like a comment areignored (see'comments' option). If acount is given,the count'th matching line is displayed, and commentlines are not ignored. {not in Vi}*]i*]ilike "[i", but start at the current cursor position.{not in Vi}*:is* *:isearch*:[range]is[earch][!][count] [/]pattern[/]Like "[i" and "]i", but search in[range] lines(default: whole file).See |:search-args| for [/] and [!]. {not in Vi}*[I*[IDisplay all lines that contain the keyword under thecursor. Filenames and line numbers are displayedfor the found lines. The search starts at thebeginning of the file. {not in Vi}*]I*]Ilike "[I", but start at the current cursor position.{not in Vi}*:il* *:ilist*:[range]il[ist][!] [/]pattern[/]Like "[I" and "]I", but search in[range] lines(default: whole file).See |:search-args| for [/] and [!]. {not in Vi}*[_CTRL-I*[CTRL-IJump to the first line that contains the keywordunder the cursor. The search starts at the beginningof the file. Lines that look like a comment areignored (see'comments' option). If acount is given,the count'th matching line is jumped to, and commentlines are not ignored. {not in Vi}*]_CTRL-I*]CTRL-Ilike "[ CTRL-I", but start at the current cursorposition. {not in Vi}*:ij* *:ijump*:[range]ij[ump][!][count] [/]pattern[/]Like "[ CTRL-I" and "] CTRL-I", but search in[range] lines (default: whole file).See |:search-args| for [/] and [!]. {not in Vi}CTRL-WCTRL-I*CTRL-W_CTRL-I* *CTRL-W_i*CTRL-WiOpen a newwindow, with the cursor on the first linethat contains the keyword under the cursor. Thesearch starts at the beginning of the file. Linesthat look like a comment line are ignored (see'comments' option). If acount is given, the count'thmatching line is jumped to, and comment lines are notignored. {not in Vi}*:isp* *:isplit*:[range]isp[lit][!][count] [/]pattern[/]Like "CTRL-W i" and "CTRL-W i", but search in[range] lines (default: whole file).See |:search-args| for [/] and [!]. {not in Vi}*[d*[dDisplay the firstmacro definition that contains themacro under the cursor. The search starts from thebeginning of the file. If acount is given, thecount'th matching line is displayed. {not in Vi}*]d*]dlike "[d", but start at the current cursor position.{not in Vi}*:ds* *:dsearch*:[range]ds[earch][!][count] [/]string[/]Like "[d" and "]d", but search in[range] lines(default: whole file).See |:search-args| for [/] and [!]. {not in Vi}*[D*[DDisplay allmacrodefinitions that contain themacrounder the cursor. Filenames and line numbers aredisplayed for the found lines. The search startsfrom the beginning of the file. {not in Vi}*]D*]Dlike "[D", but start at the current cursor position.{not in Vi}*:dli* *:dlist*:[range]dl[ist][!] [/]string[/]Like "[D" and "]D", but search in[range] lines(default: whole file).See |:search-args| for [/] and [!]. {not in Vi}Note that ":dl" works like ":delete" with the "l"flag.*[_CTRL-D*[CTRL-DJump to the firstmacro definition that contains thekeyword under the cursor. The search starts fromthe beginning of the file. If acount is given, thecount'th matching line is jumped to. {not in Vi}*]_CTRL-D*]CTRL-Dlike "[ CTRL-D", but start at the current cursorposition. {not in Vi}*:dj* *:djump*:[range]dj[ump][!][count] [/]string[/]Like "[ CTRL-D" and "] CTRL-D", but search in[range] lines (default: whole file).See |:search-args| for [/] and [!]. {not in Vi}CTRL-WCTRL-D*CTRL-W_CTRL-D* *CTRL-W_d*CTRL-WdOpen a newwindow, with the cursor on the firstmacro definition line that contains the keywordunder the cursor. The search starts from thebeginning of the file. If acount is given, thecount'th matching line is jumped to. {not in Vi}*:dsp* *:dsplit*:[range]dsp[lit][!][count] [/]string[/]Like "CTRL-W d", but search in[range] lines(default: whole file).See |:search-args| for [/] and [!]. {not in Vi}*:che* *:checkpath*:che[ckpath]List all the included files that could not be found.{not in Vi}:che[ckpath]!List all the included files. {not in Vi}*:search-args*Common arguments for the commands above:[!] When included, find matches in lines that are recognizedas comments. When excluded, a match is ignored when the line is recognizedas a comment (according to 'comments'), or the match is in a C comment (after "//" or inside /* */). Note that a match may be missed if a line is recognizedas a comment, but the comment ends halfway the line. And if the line is a comment, but it is not recognized (according to'comments') a match may be found in it anyway. Example:/* comment foobar */ A match for "foobar" is found, because this line is not recognizedas a comment (even thoughsyntax highlighting does recognize it). Note: Since amacro definition mostly doesn't look like a comment, the [!] makes no difference for ":dlist", ":dsearch" and ":djump".[/] Apattern can be surrounded by '/'. Without '/' only whole words are matched, using thepattern "\<pattern\>". Only after the second '/' a next command can be appended with '|'. Example::isearch /string/ | echo "the last one" For a ":djump", ":dsplit", ":dlist" and ":dsearch" command thepattern is usedas a literal string, notas a searchpattern.top -main help file
[8]ページ先頭