Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 242 lines (199 sloc) 9.83 kb
c364a61 Jeet Sukumaran Initial commit
authored
1 *filesearch.txt* Filesystem searching utility.
2
3 ===============================================================================
4 *filesearch* *filesearch-contents*
5 CONTENTS~
6
7 1. Introduction ....................... |filesearch-introduction|
8 2. Commands ........................... |filesearch-commands|
9 3. Filetype Options .. ............... |filesearch-filetype-options|
10 4. Key Mappings (Catalog Viewer) ...... |filesearch-keys|
11 5. Options and Settings ............... |filesearch-options|
12
13 ===============================================================================
14 *filesearch-introduction*
15 INTRODUCTION~
16
17 Filesearch is a plugin for searching the local filesystem for files by name or
18 content, using glob or regular expression patterns. By default searches are
19 carried out recursively starting from the current directory, but the search
20 paths can be adjusted through the use of optional arguments. Searches can be
21 restricted to specific filetypes through the use of filetype filter options
22 (e.g., "py" for Python files, "cpp" for C++ source and header files).
23
24 Results will be shown in new buffer (the "catalog viewer"). They can be
25 browsed using all the normal Vim |movement| keys, and can be selected for
26 viewing the in main (previous) window, a new vertical or horizontal split
27 window, or new tab page (see |filesearch-keys|).
28
29 ===============================================================================
30 *filesearch-commands*
31 COMMANDS~
32
33 These following commands are provided globally by Filesearch:
34
35 *:Fsglob*
36 :Fsglob /{glob}/[filetype-options] [paths]
37
38 Search filesystem for files with names matching the glob pattern {glob},
39 which can include |wildcard| and |startstar-wildcard| characters.
40
41 *:Fsfind*
42 :Fsfind /{pattern}/[filetype-options] [paths]
43
44 Search filesystem for files with names matching the regular expression
45 pattern given by {pattern}.
46
47 *:Fsgrep*
48 :Fsgrep /{pattern}/[filetype-options] [paths]
49
50 Search filesystem for files with lines of content matching the regular
51 expression pattern {pattern}.
52
53 By default, the current working directory is searched recursively. This can be
54 changed by specifying one or more directories to search using the [paths]
55 argument. The directory paths here can contain |wildcard| and
56 |startstar-wildcard| characters.
57
58 You can restrict the searches to files of specific types by providing one or
59 more filetype filters to use in [filetype-options] (see
60 |filesearch-filetype-filters|). Multiple filters should be separated by
61 commas, and no spaces should be present.
62
63 Instead of enclosing the {glob} or {pattern} in '/', any
64 non-ID character (see |'isident'|) can be used, so long as
65 it does not appear in the {glob} or {pattern}.
66
67 Some examples of use:
68 >
69 :Fsglob /__init__.*/
70 :Fsglob /progress???.*/ ~/src /var/downloads/**
71 :Fsglob /tree??px*/py,rst,txt
72 :Fsglob /data*/cpp,txt ~/projects
73 :Fsglob @/lib/qt*/@cpp
74
75 :Fsfind /data[A-Za-z]\d\+/
76 :Fsfind /\cfileio.*/ ~/src /var/downloads/**
77 :Fsfind /tree.*/python,rst,txt
78 :Fsfind /tree.*/ruby,rake
79 :Fsfind @/usr/local.*/.*txt@
80
81 :Fsgrep /def read_\w\+(/
82 :Fsgrep /def read_\w\+(/python,rst
83 :Fsgrep /void\s\+\w\+\(zipio\|rawio\)/cpp . ../backups ~/src
84 :Fsgrep /^\s*class\s+\w+.*:/py ~/src ~/lib/src .
85 :Fsgrep @^\s*def\s+\w+(.*)\s*:@py ~/src ~/lib/src .
86 <
87 ===============================================================================
88 *filesearch-filetype-options*
89 Filetype Options~
90
91 The following flags can be used in |Fsglob|, |Fsfind| and |Fsgrep| commands
92 to restrict the scope of the file search. Multiple options should be separated
93 by commas. If multiple options are given, then the scope is the union of the
94 options (e.g., "python,cpp" means to search for Python OR C++ files). No spaces
95 should be present in the option specification. Filetypes are identified based
96 on the extension.
97
98 as .as .mxml
99 ada .ada .adb .ads
100 asm .asm .s
101 batch .bat .cmd
102 cc .c .h .xs
103 cfmx .cfc .cfm .cfml
104 cpp .cpp .cc .cxx .m .hpp .hh .h .hxx
105 csharp .cs
106 css .css
107 elisp .el
108 erlang .erl .hrl
109 fortran .f .f77 .f90 .f95 .f03 .for .ftn .fpp
110 haskell .hs .lhs
111 hh .h
112 html .htm .html .shtml .xhtml
113 java .java .properties
114 js .js
115 jsp .jsp .jspx .jhtm .jhtml
116 lisp .lisp .lsp
117 lua .lua
118 make Makefiles
119 mason .mas .mhtml .mpl .mtxt
120 objc .m .h
121 objcpp .mm .h
122 ocaml .ml .mli
123 parrot .pir .pasm .pmc .ops .pod .pg .tg
124 perl .pl .pm .pod .t
125 php .php .phpt .php3 .php4 .php5 .phtml
126 plone .pt .cpt .metadata .cpy .py
127 py .py
128 python .py
129 rake Rakefiles
130 rst .rst .txt .inc
131 ruby .rb .rhtml .rjs .rxml .erb .rake
132 scala .scala
133 scheme .scm .ss
134 shell .sh .bash .csh .tcsh .ksh .zsh
135 smalltalk .st
136 sql .sql .ctl
137 tcl .tcl .itcl .itk
138 tex .tex .cls .sty
139 txt .txt
140 tt .tt .tt2 .ttml
141 vb .bas .cls .frm .ctl .vb .resx
142 vim .vim
143 xml .xml .dtd .xslt .ent
144 yaml .yaml .yml
145
146 ===============================================================================
147 *filesearch-keys*
148 KEY MAPPINGS ~
149
150 The results viewer supports the following key mappings.
151
152 -------------------------------------------------------------------------------
153 Catalog Management~
154
155 cs Cycle through sort regimes.
97828f7 Jeet Sukumaran help doc update
authored
156 cd Cycle through display regimes.
c364a61 Jeet Sukumaran Initial commit
authored
157 r Update (rebuild/refresh) index.
158 d Delete the selected buffer.
159 D Unconditionally delete the selected buffer.
160 x Wipe the selected buffer.
161 X Unconditionally wipe the selected buffer.
162 q Quit the index/catalog window.
163
164 -------------------------------------------------------------------------------
97828f7 Jeet Sukumaran help doc update
authored
165 Movement Within the Catalog Viewer~
166
167 The following special mappings are defined to jump quickly to the next entry
168 or file group.
169
170 <C-N> Go to the next index entry.
171 <C-P> Go to the previous index entry.
172 ]f Go to the next file entry.
173 [f Go the previous file entry.
174
175 -------------------------------------------------------------------------------
c364a61 Jeet Sukumaran Initial commit
authored
176 Open Selected Buffer~
177
178 The following keys all open the currently-selected buffer and switch focus to
179 it. The catalog buffer will be closed if 'g:filesearch_autodismiss_on_select'
180 evaluates to true; otherwise it will be kept open.
181
182 <CR>, o Open the currently-selected buffer in previous window.
183 s Open the currently-selected buffer in a new vertical
184 split.
185 i Open the currently-selected buffer in a new split.
186 t Open the currently-selected buffer in a new tab page.
187
188 -------------------------------------------------------------------------------
189 Preview Selected Buffer~
190
191 The following keys all open the currently-selected buffer, but retain focus on
192 the catalog viewer.
193
194 O, go Preview the currently-selected buffer in the previous
195 window.
196 S, gs Preview the currently-selected buffer is a new vertical
197 split.
198 I, gi Preview the currently-selected buffer is a new split
199 T Preview the currently-selected buffer is a new tab
200 page.
201 <SPACE>, <C-N> Go to the next buffer entry and preview it in the previous
202 window.
203 <C-SPACE>, <C-P> Go to the previous buffer entry and preview it in the
204 previous window.
205 -------------------------------------------------------------------------------
206 Window Control~
207
208 A Zoom/unzoom window, expanding to full height (if
209 horizontally split) or full width (if vertically split)
210
211 ===============================================================================
212 *filesearch-options*
213 OPTIONS AND SETTINGS~
214
215 The following options can be used to customize the behavior of this plugin:
216
217 g:filesearch_viewport_split_policy~
218 Default: "L"
219 Determines how a new Filesearch window will be opened. Can be one of the
220 following values:
221 "L" : vertical left (full screen height)
222 "R" : vertical right (full screen height)
223 "T" : horizontal top (full screen width)
224 "B" : horizontal bottom (full screen width)
225
226 g:filesearch_autodismiss_on_select~
227 Default: 1
228 If true, then selection an entry with <CR> will close the catalog. Otherwise,
229 catalog stays open. Default is 1.
230
231 g:filesearch_autoexpand_on_split~
232 Default: 1
233 If true and running in GUI mode, then the application screen will be expanded
234 to accommodate the Filesearch window.
235
236 g:filesearch_split_size~
237 Default: 40
238 If greater than 0, this will be the width of the Filesearch window in any
239 vertical splitting mode, or its height in any horizontal splitting mode.
240
241 vim:tw=78:ts=8:ft=help:norl:
Something went wrong with that request. Please try again.