Skip to content

Commit 62c055c

Browse files
author
yssl
committed
Update doc
1 parent 889df49 commit 62c055c

File tree

3 files changed

+203
-75
lines changed

3 files changed

+203
-75
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ If your vim doesn't support python, one of the easiest solutions would be instal
5050
5. Note that your ```set tags=...``` setting should have ```./tags;,tags;``` to use the generated tag file (The name of the tag file is set by```g:vintsearch_tagfilename```).
5151
6. Move the cursor to one of the functions or variables. Typing **:VIntSearchCursor symbol n l** or **:VIntSearchCursor text n l** will give search results in the quickfix window. Typing **:VIntSearchPrintStack** will show the search stack.
5252

53-
## Search Types / Search Commands
53+
## Search Types / Commands
5454

5555
VIntSearch supports symbol search, text search, and file search.
5656
Currently, available search commands for each type of search are as follows:

autoload/VIntSearch.vim

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,6 @@ function! s:DoFinishingWork(qflist, keyword, searchtype, searchcmd, options, jum
496496
endif
497497

498498
redraw
499-
if exists('g:vintsearch_codeexts')
500-
echom 'VIntSearch: g:vintsearch_codeexts is deprecated. Please use g:vintsearch_includepatterns instead.'
501-
endif
502499
if exists('g:vintsearch_search_include_patterns')
503500
echom 'VIntSearch: g:vintsearch_search_include_patterns is deprecated. Please use g:vintsearch_includepatterns instead.'
504501
endif

doc/VIntSearch.txt

Lines changed: 202 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,22 @@ Contents *VIntSearch-contents*
88

99
1. Introduction ......................... |VIntSearch-intro|
1010
2. Getting Started ...................... |VIntSearch-gettingstarted|
11-
3. Search Path .......................... |VIntSearch-searchpath|
12-
4. Search Commands ...................... |VIntSearch-searchcommands|
13-
5. Stack Commands ....................... |VIntSearch-stackcommands|
14-
6. Options .............................. |VIntSearch-options|
15-
7. Key Mappings ......................... |VIntSearch-keymappings|
16-
8. Changelog ............................ |VIntSearch-changelog|
11+
3. Search Types / Commands .............. |VIntSearch-searchtypes|
12+
4. Search Path / Tag Commands ........... |VIntSearch-searchpathtagcommands|
13+
5. Search Commands ...................... |VIntSearch-searchcommands|
14+
6. Stack Commands ....................... |VIntSearch-stackcommands|
15+
7. Options .............................. |VIntSearch-options|
16+
8. Key Mappings ......................... |VIntSearch-keymappings|
17+
9. Deprecated Commands & Options ........ |VIntSearch-deprecated|
18+
10. Changelog ............................ |VIntSearch-changelog|
1719

1820
==============================================================================
1921
1. Introduction *VIntSearch-intro*
2022

21-
|VIntSearch| is a vim plugin providing an integrated interface across various
22-
types of searches. It currently supports symbol search (by ctags), text search
23-
(by grep), and file search (by find).
24-
Search results are given in the quickfix window and a user can conviniently Move
25-
to previous or next search results via the integrated search stack.
23+
|VIntSearch| is a vim plugin providing an integrated interface across various
24+
types of searches. It currently supports symbol search, text search, and file search.
25+
Search results are given in the quickfix window and a user can conviniently
26+
move forward / backward through the integrated search history.
2627
VIntSearch means Vim Integrated Search.
2728

2829
## Features
@@ -50,24 +51,40 @@ VIntSearch means Vim Integrated Search.
5051

5152
3. Open one of your source files with vim.
5253

53-
4. Build a tag file by typing |:VIntSearchBuildTag|. The tag file will be c
54-
reated in the nearest ancestor dir of the source file that contains
54+
4. Build a tag file by typing |:VIntSearchBuildSymbolDB|. The tag file will be
55+
created in the nearest ancestor dir of the source file that contains
5556
a repository dir such as `.git`,
5657
or in the current working dir if the source file is not managed by any
5758
version control system.
58-
(Type `:help g:vintsearch_searchpathmode` for more detail)
59+
(You can change this behavior via `g:vintsearch_searchpathmode`)
5960

6061
5. Note that your `set tags=...` setting should have `./tags;,tags;` to use
6162
the generated tag file.
6263
(The name of the tag file can be changed by setting |g:vintsearch_tagfilename|)
6364

6465
6. Move the cursor to one of the functions or variables.
65-
Typing |:VIntSearchGrepCursor| n l or |:VIntSearchCtagsCursor| n l will
66+
Typing |:VIntSearchCursor| symbol n l or |:VIntSearchCursor| text n l will
6667
give search results in the quickfix window.
6768
Typing |:VIntSearchPrintStack| will show the search stack.
6869

6970
==============================================================================
70-
3. Search Path / Tag Commands *VIntSearch-searchpathtagcommands*
71+
3. Search Types / Commands *VIntSearch-searchtypes*
72+
73+
VIntSearch supports symbol search, text search, and file search.
74+
Currently, available search commands for each type of search are as follows:
75+
76+
- Symbol search
77+
- ctags
78+
- Text search
79+
- grep
80+
- File search
81+
- find
82+
83+
You can set the default commands for search types via `g:vintsearch_symbol_defaultcmd`,
84+
`g:vintsearch_text_defaultcmd`, and `g:vintsearch_file_defaultcmd`.
85+
86+
==============================================================================
87+
4. Search Path / Tag Commands *VIntSearch-searchpathtagcommands*
7188

7289
The search path is a directory 1) that is recursively searched by grep,
7390
2) that is the root of the entire source directory tree for which a tag file is generated,
@@ -77,39 +94,63 @@ It is determined by |g:vintsearch_searchpathmode|.
7794
*:VIntSearchPrintPath*, *:VSpath*
7895
Print current search path.
7996

80-
*:VIntSearchBuildTag*, *:VSbtag*
81-
Build a tag file for the search path.
97+
*:VIntSearchBuildSymbolDB*, *:VSbuild*
98+
Build a symbol db file for the search path.
8299

83100
==============================================================================
84-
4. Search Commands *VIntSearch-searchcommands*
101+
5. Search Commands *VIntSearch-searchcommands*
85102

86-
*:VIntSearchCtags* [keyword], *:VSctags* [keyword]
87-
Search for [keyword] by ctags.
103+
*:VSsymbol* [keyword]
104+
Search symbol for [keyword] (by default using ctags).
105+
106+
*:VStext* [keyword] [options]
107+
Search text for [keyword] with [options] (by default using grep, [option] is grep option).
108+
[keyword] can be double-quoted and the argument order can be changed.
88109

89-
*:VIntSearchGrep* [keyword] [grep_options], *:VSgrep* [keyword] [grep_options]
90-
Search for [keyword] by grep with [grep_options]. [keyword] can be double-quoted and the argument order can be changed.
91110
For example:
92111
```
93-
:VSgrep tags
94-
:VSgrep "let tags"
95-
:VSgrep tags -i
96-
:VSgrep -i tags
97-
:VSgrep "let tags" -i
112+
:VStext tags
113+
:VStext "let tags"
114+
:VStext tags -i
115+
:VStext -i tags
116+
:VStext "let tags" -i
98117
```
99-
(See ```man grep``` for more details about [grep_options])
118+
(See ```man grep``` for more details about [options])
100119

101-
*:VIntSearchCFGrep* [keyword] [grep_options], *:VScfgrep* [keyword] [grep_options]
102-
Search for [keyword] by grep with [grep_options] in the current file.
120+
*:VSfile* [keyword] [options]
121+
Search file for [keyword] with [options] (by default using find).
122+
Curently only works with -path options of find command.
103123

104-
*:VIntSearchFind* [keyword], *:VSfind* [keyword]
105-
Search for [keyword] by find (file search). Curently works with -path options of find command.
106124
For example,
107125
```
108126
:VSfind *test-class.cpp
109127
```
110128

111-
*:VIntSearchCtagsCursor* [vimmode] [action]
112-
Search for keyword under the cursor by ctags.
129+
*:VScftext* [keyword] [options]
130+
Search text for [keyword] with [options] in the current file.
131+
132+
--------------------
133+
*:VIntSearch* [search type] [keyword] [options]
134+
A search command taking a search type as an argument.
135+
136+
[search type] can be one of:
137+
- symbol
138+
- text
139+
- file
140+
- cftext
141+
142+
For example,
143+
`:VIntSearch text "this is"` is same to `:VStext "this is"`.
144+
145+
*:VIntSearchCmd* [search type] [search command] [keyword] [options]
146+
A search command taking a search type and a search command as arguments.
147+
For example,
148+
`:VIntSearchCmd text grep "this is"` is same to `:VStext "this is"`
149+
with `grep` as the default text search command.
150+
151+
--------------------
152+
*:VIntSearchCursor* [search type] [vimmode] [action]
153+
Search for keyword under the cursor with a specified [search type].
113154

114155
[vimmode] can be one of:
115156
- 'n' : Use this if vim is in normal mode. Then keyword is the word under the cursor.
@@ -119,17 +160,12 @@ Search for keyword under the cursor by ctags.
119160
- 'l' : List search result in the quickfix window and open the quickfix window.
120161
- 'j' : Jump to the first search result. The quickfix window is also updated but not opened.
121162

122-
*:VIntSearchGrepCursor* [vimmode] [action]
123-
Search for keyword under the cursor by grep.
124-
125-
*:VIntSearchCFGrepCursor* [vimmode] [action]
126-
Search for keyword under the cursor by grep in the current file.
163+
*:VIntSearchCursorCmd* [search type] [search command] [vimmode] [action]
164+
Search for keyword under the cursor with a specified [search type] and a
165+
[search command].
127166

128-
+**:VIntSearchFindCursor** [vimmode] [action]
129-
+Search for *keyword* under the cursor by find (file search).
130-
+
131167
==============================================================================
132-
5. Stack Commands *VIntSearch-stackcommands*
168+
6. Stack Commands *VIntSearch-stackcommands*
133169

134170
Search stack contains your search history - search keywords you jumped to,
135171
from which file, and search results in the quickfix also.
@@ -168,7 +204,7 @@ such as [QFEnter](http://www.vim.org/scripts/script.php?script_id=4778).
168204
`let g:qfenter_cc_cmd = 'VScc ##'` in your .vimrc.)
169205

170206
==============================================================================
171-
6. Options *VIntSearch-options*
207+
7. Options *VIntSearch-options*
172208

173209
*g:vintsearch_searchpathmode*
174210
A option to determine the search path.
@@ -199,26 +235,26 @@ Default: >
199235
let g:vintsearch_repodirs = ['.git', '.hg', '.svn']
200236
<
201237

202-
*g:vintsearch_search_include_patterns*
238+
*g:vintsearch_includepatterns*
203239
File patterns to specified files being searched.
204-
The tag file generated by |:VIntSearchBuildTag| will only contain files
240+
The symbol db file generated by |:VIntSearchBuildSymbolDB| will only contain files
205241
including these patterns in their paths.
206-
:VIntSearch*Grep commands will search files only including these patterns in
242+
|:VStext| commands will search files only including these patterns in
207243
their names.
208244
Default: >
209-
let g:vintsearch_search_include_patterns =
245+
let g:vintsearch_includepatterns =
210246
\ ['*.c','*.cpp','*.h','*.hpp','*.inl','*.py','*.lua','*.vim','*.js',
211247
\'*.md','*.txt','*.tex']
212248
<
213249

214-
*g:vintsearch_search_exclude_patterns*
250+
*g:vintsearch_excludepatterns*
215251
File patterns to specified files not being searched.
216-
The tag file generated by |:VIntSearchBuildTag| will only contain files
252+
The symbol db file generated by |:VIntSearchBuildSymbolDB| will only contain files
217253
excluding these patterns in their paths.
218-
:VIntSearch*Grep commands will search files only excluding these patterns in
254+
|:VStext| commands will search files only excluding these patterns in
219255
their names and paths.
220-
If a file matches patterns in both |g:vintsearch_search_include_patterns| and
221-
*g:vintsearch_search_exclude_patterns*, it will be excluded from search results.
256+
If a file matches patterns in both |g:vintsearch_includepatterns| and
257+
*g:vintsearch_excludepatterns*, it will be excluded from search results.
222258
Default: >
223259
let g:vintsearch_search_exclude_patterns =
224260
\ []
@@ -259,8 +295,26 @@ If you don't want to use keyword highlighting, just set the option as:
259295
let g:vintsearch_highlight_group = ''
260296
<
261297

298+
*g:vintsearch_symbol_defaultcmd*
299+
Default search command for symbol search.
300+
Default: >
301+
let g:vintsearch_symbol_defaultcmd = 'ctags'
302+
<
303+
304+
*g:vintsearch_text_defaultcmd*
305+
Default search command for text search.
306+
Default: >
307+
let g:vintsearch_text_defaultcmd = 'grep'
308+
<
309+
310+
*g:vintsearch_file_defaultcmd*
311+
Default search command for file search.
312+
Default: >
313+
let g:vintsearch_file_defaultcmd = 'find'
314+
<
315+
262316
==============================================================================
263-
7. Key Mappings *VIntSearch-keymappings*
317+
8. Key Mappings *VIntSearch-keymappings*
264318

265319
VIntSearch does not provide default key mappings to keep your key mappings clean.
266320
Instead, I suggest convenient one what I'm using now.
@@ -277,29 +331,106 @@ endfunction
277331
call s:nnoreicmap('','<A-3>',':VIntSearchMoveBackward<CR>')
278332
call s:nnoreicmap('','<A-4>',':VIntSearchMoveForward<CR>')
279333

280-
call s:nnoreicmap('','<A-]>',':VIntSearchCtagsCursor n j<CR>')
281-
call s:nnoreicmap('','g]',':VIntSearchCtagsCursor n l<CR>')
282-
call s:nnoreicmap('','g[',':VIntSearchGrepCursor n l<CR><CR>')
283-
call s:nnoreicmap('','g{',':VIntSearchCFGrepCursor n l<CR><CR>')
284-
call s:nnoreicmap('','g\',':VIntSearchFindCursor n l<CR><CR>')
285-
vnoremap <A-]> :<C-u>VIntSearchCtagsCursor v j<CR>
286-
vnoremap g] :<C-u>VIntSearchCtagsCursor v l<CR>
287-
vnoremap g[ :<C-u>VIntSearchGrepCursor v l<CR><CR>
288-
vnoremap g{ :<C-u>VIntSearchCFGrepCursor v l<CR><CR>
289-
vnoremap g\ :<C-u>VIntSearchFindCursor v l<CR><CR>
334+
call s:nnoreicmap('','<A-]>',':VIntSearchCursor symbol n j<CR>')
335+
call s:nnoreicmap('','g]',':VIntSearchCursor symbol n l<CR>')
336+
call s:nnoreicmap('','g[',':VIntSearchCursor text n l<CR><CR>')
337+
call s:nnoreicmap('','g{',':VIntSearchCursor cftext n l<CR><CR>')
338+
call s:nnoreicmap('','g\',':VIntSearchCursor file n l<CR><CR>')
339+
vnoremap <A-]> :<C-u>VIntSearchCursor symbol v j<CR>
340+
vnoremap g] :<C-u>VIntSearchCursor symbol v l<CR>
341+
vnoremap g[ :<C-u>VIntSearchCursor text v l<CR><CR>
342+
vnoremap g{ :<C-u>VIntSearchCursor cftext v l<CR><CR>
343+
vnoremap g\ :<C-u>VIntSearchCursor file v l<CR><CR>
290344

291345
call s:nnoreicmap('','<F8>',':VScnext<CR>')
292346
call s:nnoreicmap('','<S-F8>',':VScprev<CR>')
293347
```
294348

295-
I've define the function `s:nnoreicmap()` to map for normal, insert and
296-
command-line modes simultaneously,
297-
and installed ![vim-fixkey](https://github.com/drmikehenry/vim-fixkey) plugin
298-
to use alt-key mappings.
299-
`<A-T>` means alt+shift+t.
349+
`s:nnoreicmap()` is a function to register mappings for normal, insert and
350+
command-line modes simultaneously. I installed ![vim-fixkey]
351+
(https://github.com/drmikehenry/vim-fixkey) to use alt-key mappings.
352+
353+
==============================================================================
354+
9. Deprecated Commands & Options *VIntSearch-deprecated*
355+
356+
Those commands are deprecated since version 1.3.0 and are supposed to be removed
357+
in version 1.4.0.
358+
359+
*:VIntSearchBuildTag*, *:VSbtag*
360+
Build a tag file for the search path.
361+
362+
*:VIntSearchCtags* [keyword], *:VSctags* [keyword]
363+
Search for [keyword] by ctags.
364+
365+
*:VIntSearchGrep* [keyword] [grep_options], *:VSgrep* [keyword] [grep_options]
366+
Search for [keyword] by grep with [grep_options]. [keyword] can be double-quoted and the argument order can be changed.
367+
For example:
368+
```
369+
:VSgrep tags
370+
:VSgrep "let tags"
371+
:VSgrep tags -i
372+
:VSgrep -i tags
373+
:VSgrep "let tags" -i
374+
```
375+
(See ```man grep``` for more details about [grep_options])
376+
377+
*:VIntSearchCFGrep* [keyword] [grep_options], *:VScfgrep* [keyword] [grep_options]
378+
Search for [keyword] by grep with [grep_options] in the current file.
379+
380+
*:VIntSearchFind* [keyword], *:VSfind* [keyword]
381+
Search for [keyword] by find (file search). Curently works with -path options of find command.
382+
For example,
383+
```
384+
:VSfind *test-class.cpp
385+
```
386+
387+
*:VIntSearchCtagsCursor* [vimmode] [action]
388+
Search for keyword under the cursor by ctags.
389+
390+
[vimmode] can be one of:
391+
- 'n' : Use this if vim is in normal mode. Then keyword is the word under the cursor.
392+
- 'v' : Use this if vim is in visual mode. Then keyword is the visually selected text.
393+
394+
[action] can be one of:
395+
- 'l' : List search result in the quickfix window and open the quickfix window.
396+
- 'j' : Jump to the first search result. The quickfix window is also updated but not opened.
397+
398+
*:VIntSearchGrepCursor* [vimmode] [action]
399+
Search for keyword under the cursor by grep.
400+
401+
*:VIntSearchCFGrepCursor* [vimmode] [action]
402+
Search for keyword under the cursor by grep in the current file.
403+
404+
**:VIntSearchFindCursor** [vimmode] [action]
405+
Search for *keyword* under the cursor by find (file search).
406+
407+
*g:vintsearch_search_include_patterns*
408+
File patterns to specified files being searched.
409+
The tag file generated by |:VIntSearchBuildTag| will only contain files
410+
including these patterns in their paths.
411+
:VIntSearch*Grep commands will search files only including these patterns in
412+
their names.
413+
Default: >
414+
let g:vintsearch_search_include_patterns =
415+
\ ['*.c','*.cpp','*.h','*.hpp','*.inl','*.py','*.lua','*.vim','*.js',
416+
\'*.md','*.txt','*.tex']
417+
<
418+
419+
*g:vintsearch_search_exclude_patterns*
420+
File patterns to specified files not being searched.
421+
The tag file generated by |:VIntSearchBuildTag| will only contain files
422+
excluding these patterns in their paths.
423+
:VIntSearch*Grep commands will search files only excluding these patterns in
424+
their names and paths.
425+
If a file matches patterns in both |g:vintsearch_search_include_patterns| and
426+
*g:vintsearch_search_exclude_patterns*, it will be excluded from search results.
427+
Default: >
428+
let g:vintsearch_search_exclude_patterns =
429+
\ []
430+
<
300431

301432
==============================================================================
302-
8. Changelog *VIntSearch-changelog*
433+
10. Changelog *VIntSearch-changelog*
303434

304435
1.2.2 2015/07/09
305436
- Add hightlight option for search result (g:vintsearch_highlight_group)

0 commit comments

Comments
 (0)