bgneal@3
|
1 *ctrlp.txt* Fuzzy file, buffer, mru and tag finder. v1.6.5
|
bgneal@0
|
2 *CtrlP* *ControlP* *'ctrlp'* *'ctrl-p'*
|
bgneal@0
|
3 ===============================================================================
|
bgneal@0
|
4 # #
|
bgneal@0
|
5 # :::::::: ::::::::::: ::::::::: ::: ::::::::: #
|
bgneal@0
|
6 # :+: :+: :+: :+: :+: :+: :+: :+: #
|
bgneal@0
|
7 # +:+ +:+ +:+ +:+ +:+ +:+ +:+ #
|
bgneal@0
|
8 # +#+ +#+ +#++:++#: +#+ +#++:++#+ #
|
bgneal@0
|
9 # +#+ +#+ +#+ +#+ +#+ +#+ #
|
bgneal@0
|
10 # #+# #+# #+# #+# #+# #+# #+# #
|
bgneal@0
|
11 # ######## ### ### ### ########## ### #
|
bgneal@0
|
12 # #
|
bgneal@0
|
13 ===============================================================================
|
bgneal@0
|
14 CONTENTS *ctrlp-contents*
|
bgneal@0
|
15
|
bgneal@0
|
16 1. Intro........................................|ctrlp-intro|
|
bgneal@0
|
17 2. Options......................................|ctrlp-options|
|
bgneal@0
|
18 3. Commands.....................................|ctrlp-commands|
|
bgneal@0
|
19 4. Mappings.....................................|ctrlp-mappings|
|
bgneal@0
|
20 5. Input Formats................................|ctrlp-input-formats|
|
bgneal@0
|
21 6. Extensions...................................|ctrlp-extensions|
|
bgneal@0
|
22
|
bgneal@0
|
23 ===============================================================================
|
bgneal@0
|
24 1. Intro *ctrlp-intro*
|
bgneal@0
|
25
|
bgneal@3
|
26 Full path fuzzy file, buffer, mru and tag finder with an intuitive interface.
|
bgneal@0
|
27 Written in pure Vimscript for MacVim and Vim version 7.0+. Has full support for
|
bgneal@3
|
28 Vim’s |regexp| as search pattern, built-in MRU files monitoring, project’s root
|
bgneal@0
|
29 finder, and more.
|
bgneal@0
|
30
|
bgneal@0
|
31 To enable optional extensions (tag, quickfix, dir...), see |ctrlp-extensions|.
|
bgneal@0
|
32
|
bgneal@0
|
33 ===============================================================================
|
bgneal@0
|
34 2. Options *ctrlp-options*
|
bgneal@0
|
35
|
bgneal@0
|
36 Below are the available options and their default values:~
|
bgneal@0
|
37
|
bgneal@0
|
38 *'g:ctrlp_map'*
|
bgneal@0
|
39 Use this option to change the mapping to invoke |CtrlP| in |Normal| mode: >
|
bgneal@0
|
40 let g:ctrlp_map = '<c-p>'
|
bgneal@0
|
41 <
|
bgneal@0
|
42
|
bgneal@3
|
43 *'g:ctrlp_cmd'*
|
bgneal@3
|
44 Set the default opening command to use when pressing the above mapping: >
|
bgneal@3
|
45 let g:ctrlp_cmd = 'CtrlP'
|
bgneal@3
|
46 <
|
bgneal@3
|
47
|
bgneal@0
|
48 *'g:loaded_ctrlp'*
|
bgneal@3
|
49 Use this to disable the plugin completely: >
|
bgneal@0
|
50 let g:loaded_ctrlp = 1
|
bgneal@0
|
51 <
|
bgneal@0
|
52
|
bgneal@0
|
53 *'g:ctrlp_by_filename'*
|
bgneal@0
|
54 Set this to 1 to set search by filename (not full path) as the default: >
|
bgneal@0
|
55 let g:ctrlp_by_filename = 0
|
bgneal@0
|
56 <
|
bgneal@0
|
57
|
bgneal@0
|
58 *'g:ctrlp_regexp_search'*
|
bgneal@0
|
59 Set this to 1 to set |regexp| search as the default: >
|
bgneal@0
|
60 let g:ctrlp_regexp_search = 0
|
bgneal@0
|
61 <
|
bgneal@0
|
62
|
bgneal@0
|
63 *'g:ctrlp_match_window_bottom'*
|
bgneal@0
|
64 Set this to 0 to show the match window at the top of the screen: >
|
bgneal@0
|
65 let g:ctrlp_match_window_bottom = 1
|
bgneal@0
|
66 <
|
bgneal@0
|
67
|
bgneal@0
|
68 *'g:ctrlp_match_window_reversed'*
|
bgneal@0
|
69 Reverse the sort order of the matched files in the match window. The default
|
bgneal@0
|
70 setting is from bottom to top: >
|
bgneal@0
|
71 let g:ctrlp_match_window_reversed = 1
|
bgneal@0
|
72 <
|
bgneal@0
|
73
|
bgneal@0
|
74 *'g:ctrlp_max_height'*
|
bgneal@0
|
75 Set the maximum height of the match window: >
|
bgneal@0
|
76 let g:ctrlp_max_height = 10
|
bgneal@0
|
77 <
|
bgneal@0
|
78
|
bgneal@0
|
79 *'g:ctrlp_jump_to_buffer'*
|
bgneal@3
|
80 Set this to 0 to disable the jump-to-open-buffer feature.
|
bgneal@3
|
81 Set to 2 to also jump tab if the selected buffer’s opened in another tab.
|
bgneal@3
|
82 Set to 1 to only jump to it if it’s opened in the current tab: >
|
bgneal@3
|
83 let g:ctrlp_jump_to_buffer = 2
|
bgneal@0
|
84 <
|
bgneal@0
|
85
|
bgneal@0
|
86 *'g:ctrlp_working_path_mode'*
|
bgneal@0
|
87 When starting up the prompt, temporarily set the working directory (i.e. the
|
bgneal@0
|
88 |current-directory|) to:
|
bgneal@0
|
89 1 - the parent directory of the current file.
|
bgneal@0
|
90 2 - the nearest ancestor that contains one of these directories/files:
|
bgneal@0
|
91 .git/
|
bgneal@0
|
92 .hg/
|
bgneal@0
|
93 .bzr/
|
bgneal@0
|
94 _darcs/
|
bgneal@0
|
95 root.dir
|
bgneal@0
|
96 .vimprojects
|
bgneal@0
|
97 0 - don’t manage working directory.
|
bgneal@0
|
98 >
|
bgneal@0
|
99 let g:ctrlp_working_path_mode = 2
|
bgneal@0
|
100 <
|
bgneal@0
|
101
|
bgneal@0
|
102 *'g:ctrlp_root_markers'*
|
bgneal@0
|
103 Use this to set your own root markers in addition to the default ones. Your
|
bgneal@0
|
104 markers will take precedence: >
|
bgneal@0
|
105 let g:ctrlp_root_markers = ['']
|
bgneal@0
|
106 <
|
bgneal@0
|
107 These markers (builtins and yours) will serve as identifiers for the '/' and
|
bgneal@0
|
108 '\' special inputs (section 5.e)
|
bgneal@0
|
109
|
bgneal@0
|
110 *'g:ctrlp_use_caching'*
|
bgneal@0
|
111 Set this to 0 to disable per-session caching. When disabled, caching will still
|
bgneal@0
|
112 be enabled for directories that have more than 4000 files: >
|
bgneal@0
|
113 let g:ctrlp_use_caching = 1
|
bgneal@0
|
114 <
|
bgneal@0
|
115 Note: you can quickly purge the cache by pressing <F5> while inside |CtrlP|.
|
bgneal@0
|
116
|
bgneal@0
|
117 *'g:ctrlp_clear_cache_on_exit'*
|
bgneal@0
|
118 Set this to 0 to enable cross-sessions caching: >
|
bgneal@0
|
119 let g:ctrlp_clear_cache_on_exit = 1
|
bgneal@0
|
120 <
|
bgneal@0
|
121
|
bgneal@0
|
122 *'g:ctrlp_cache_dir'*
|
bgneal@0
|
123 Set the directory to store the cache files: >
|
bgneal@0
|
124 let g:ctrlp_cache_dir = $HOME.'/.ctrlp_cache'
|
bgneal@0
|
125 <
|
bgneal@0
|
126
|
bgneal@0
|
127 *'g:ctrlp_prompt_mappings'*
|
bgneal@0
|
128 Use this to customize the mappings inside |CtrlP|’s prompt to your liking. You
|
bgneal@0
|
129 only need to keep the lines that you’ve changed the values (inside []): >
|
bgneal@0
|
130 let g:ctrlp_prompt_mappings = {
|
bgneal@0
|
131 \ 'PrtBS()': ['<bs>'],
|
bgneal@0
|
132 \ 'PrtDelete()': ['<del>'],
|
bgneal@0
|
133 \ 'PrtDeleteWord()': ['<c-w>'],
|
bgneal@0
|
134 \ 'PrtClear()': ['<c-u>'],
|
bgneal@0
|
135 \ 'PrtSelectMove("j")': ['<c-j>', '<down>'],
|
bgneal@0
|
136 \ 'PrtSelectMove("k")': ['<c-k>', '<up>'],
|
bgneal@0
|
137 \ 'PrtHistory(-1)': ['<c-n>'],
|
bgneal@0
|
138 \ 'PrtHistory(1)': ['<c-p>'],
|
bgneal@0
|
139 \ 'AcceptSelection("e")': ['<cr>', '<2-LeftMouse>'],
|
bgneal@0
|
140 \ 'AcceptSelection("h")': ['<c-x>', '<c-cr>', '<c-s>'],
|
bgneal@0
|
141 \ 'AcceptSelection("t")': ['<c-t>', '<MiddleMouse>'],
|
bgneal@0
|
142 \ 'AcceptSelection("v")': ['<c-v>', '<c-q>', '<RightMouse>'],
|
bgneal@0
|
143 \ 'ToggleFocus()': ['<tab>'],
|
bgneal@0
|
144 \ 'ToggleRegex()': ['<c-r>'],
|
bgneal@0
|
145 \ 'ToggleByFname()': ['<c-d>'],
|
bgneal@3
|
146 \ 'ToggleType(1)': ['<c-f>', '<c-up>'],
|
bgneal@0
|
147 \ 'ToggleType(-1)': ['<c-b>', '<c-down>'],
|
bgneal@0
|
148 \ 'PrtCurStart()': ['<c-a>'],
|
bgneal@0
|
149 \ 'PrtCurEnd()': ['<c-e>'],
|
bgneal@0
|
150 \ 'PrtCurLeft()': ['<c-h>', '<left>'],
|
bgneal@0
|
151 \ 'PrtCurRight()': ['<c-l>', '<right>'],
|
bgneal@0
|
152 \ 'PrtClearCache()': ['<F5>'],
|
bgneal@0
|
153 \ 'PrtDeleteMRU()': ['<F7>'],
|
bgneal@0
|
154 \ 'CreateNewFile()': ['<c-y>'],
|
bgneal@0
|
155 \ 'MarkToOpen()': ['<c-z>'],
|
bgneal@0
|
156 \ 'OpenMulti()': ['<c-o>'],
|
bgneal@0
|
157 \ 'PrtExit()': ['<esc>', '<c-c>', '<c-g>'],
|
bgneal@0
|
158 \ }
|
bgneal@0
|
159 <
|
bgneal@0
|
160 If you have problem with <bs> moving left instead of deleting a char, add this
|
bgneal@0
|
161 to your |vimrc|: >
|
bgneal@0
|
162 let g:ctrlp_prompt_mappings = {
|
bgneal@0
|
163 \ 'PrtBS()': ['<c-h>'],
|
bgneal@0
|
164 \ 'PrtCurLeft()': ['<left>'],
|
bgneal@0
|
165 \ }
|
bgneal@0
|
166 <
|
bgneal@0
|
167
|
bgneal@0
|
168 *'g:ctrlp_mruf_max'*
|
bgneal@0
|
169 Specify the number of recently opened files you want |CtrlP| to remember: >
|
bgneal@0
|
170 let g:ctrlp_mruf_max = 250
|
bgneal@0
|
171 <
|
bgneal@0
|
172
|
bgneal@0
|
173 *'g:ctrlp_mruf_exclude'*
|
bgneal@0
|
174 Files you don’t want |CtrlP| to remember; use |regexp| to specify the patterns:
|
bgneal@0
|
175 >
|
bgneal@0
|
176 let g:ctrlp_mruf_exclude = ''
|
bgneal@0
|
177 <
|
bgneal@0
|
178 Examples: >
|
bgneal@0
|
179 let g:ctrlp_mruf_exclude = '/tmp/.*\|/temp/.*' " MacOSX/Linux
|
bgneal@0
|
180 let g:ctrlp_mruf_exclude = '^C:\\dev\\tmp\\.*' " Windows
|
bgneal@0
|
181 <
|
bgneal@0
|
182
|
bgneal@0
|
183 *'g:ctrlp_mruf_include'*
|
bgneal@0
|
184 And if you want |CtrlP| to only remember some files, specify them here: >
|
bgneal@0
|
185 let g:ctrlp_mruf_include = ''
|
bgneal@0
|
186 <
|
bgneal@0
|
187 Example: >
|
bgneal@0
|
188 let g:ctrlp_mruf_include = '\.py$\|\.rb$'
|
bgneal@0
|
189 <
|
bgneal@0
|
190
|
bgneal@0
|
191 *'g:ctrlp_mruf_case_sensitive'*
|
bgneal@0
|
192 Match this with your file system case-sensitivity setting to avoid duplicate
|
bgneal@0
|
193 MRU entries: >
|
bgneal@0
|
194 let g:ctrlp_mruf_case_sensitive = 1
|
bgneal@0
|
195 <
|
bgneal@0
|
196
|
bgneal@0
|
197 *'g:ctrlp_dotfiles'*
|
bgneal@0
|
198 Set this to 0 if you don’t want |CtrlP| to search for dotfiles and dotdirs: >
|
bgneal@0
|
199 let g:ctrlp_dotfiles = 1
|
bgneal@0
|
200 <
|
bgneal@3
|
201 You can use |'wildignore'| to exclude anything from the search.
|
bgneal@3
|
202 e.g. exclude version control directories: >
|
bgneal@0
|
203 set wildignore+=*/.git/*,*/.hg/*,*/.svn/* " Linux/MacOSX
|
bgneal@0
|
204 set wildignore+=.git\*,.hg\*,.svn\* " Windows
|
bgneal@0
|
205 <
|
bgneal@3
|
206 Note: the `*/` in front of each glob is required.
|
bgneal@0
|
207
|
bgneal@0
|
208 Other note: |wildignore| influences the result of |expand()|, |globpath()| and
|
bgneal@0
|
209 |glob()| which many plugins use to find stuff on the system (e.g. fugitive.vim
|
bgneal@0
|
210 looks for .git/, some other plugins look for external exe tools on Windows).
|
bgneal@0
|
211 So be a little mindful of what you put in your |wildignore|.
|
bgneal@0
|
212
|
bgneal@3
|
213 *'g:ctrlp_custom_ignore'*
|
bgneal@3
|
214 In addition to |'wildignore'|, use this for files and directories you want only
|
bgneal@3
|
215 |CtrlP| to not show. Use |regexp| to specify the pattern: >
|
bgneal@3
|
216 let g:ctrlp_custom_ignore = ''
|
bgneal@3
|
217 <
|
bgneal@3
|
218
|
bgneal@0
|
219 *'g:ctrlp_highlight_match'*
|
bgneal@0
|
220 Use this to enable/disable highlighting of the matched patterns and to specify
|
bgneal@0
|
221 the highlight group that’ll be used: >
|
bgneal@0
|
222 let g:ctrlp_highlight_match = [1, 'Identifier']
|
bgneal@0
|
223 <
|
bgneal@0
|
224
|
bgneal@0
|
225 *'g:ctrlp_max_files'*
|
bgneal@0
|
226 The maximum number of files to scan, set to 0 for no limit: >
|
bgneal@0
|
227 let g:ctrlp_max_files = 20000
|
bgneal@0
|
228 <
|
bgneal@0
|
229
|
bgneal@0
|
230 *'g:ctrlp_max_depth'*
|
bgneal@0
|
231 The maximum depth of a directory tree to recurse into: >
|
bgneal@0
|
232 let g:ctrlp_max_depth = 40
|
bgneal@0
|
233 <
|
bgneal@0
|
234 Note: the larger these values, the more memory Vim uses.
|
bgneal@0
|
235
|
bgneal@0
|
236 *'g:ctrlp_user_command'*
|
bgneal@0
|
237 Specify an external tool to use for listing files instead of Vim’s globpath().
|
bgneal@0
|
238 Use %s in place of the target directory: >
|
bgneal@0
|
239 let g:ctrlp_user_command = ''
|
bgneal@0
|
240 <
|
bgneal@0
|
241 Examples: >
|
bgneal@0
|
242 let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux
|
bgneal@0
|
243 let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows
|
bgneal@0
|
244 <
|
bgneal@0
|
245 You can also use 'grep', 'findstr' or something else to filter the results.
|
bgneal@0
|
246 Examples: >
|
bgneal@0
|
247 let g:ctrlp_user_command = 'find %s -type f | grep (?!tmp/.*)'
|
bgneal@0
|
248 let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d | findstr .*\.py$'
|
bgneal@0
|
249 <
|
bgneal@0
|
250 Use a version control listing command when inside a repository, this is a lot
|
bgneal@0
|
251 faster when working with large projects: >
|
bgneal@0
|
252 let g:ctrlp_user_command = [repo_marker, vcs_ls_command, fallback_command]
|
bgneal@0
|
253 <
|
bgneal@0
|
254 If the fallback_command is empty or not defined, globpath() will then be used
|
bgneal@0
|
255 when searching outside a repo.
|
bgneal@0
|
256 Examples: >
|
bgneal@0
|
257 let g:ctrlp_user_command = ['.git/', 'cd %s && git ls-files']
|
bgneal@0
|
258 let g:ctrlp_user_command = ['.hg/', 'hg --cwd %s locate --fullpath -I .']
|
bgneal@0
|
259 <
|
bgneal@0
|
260
|
bgneal@0
|
261 *'g:ctrlp_open_new_file'*
|
bgneal@0
|
262 Use this option to specify how the newly created file is to be opened when
|
bgneal@0
|
263 pressing <c-y>:
|
bgneal@0
|
264 1 - in a new tab
|
bgneal@0
|
265 2 - in a new horizontal split
|
bgneal@0
|
266 3 - in a new vertical split
|
bgneal@0
|
267 0 - in the current window
|
bgneal@0
|
268 >
|
bgneal@0
|
269 let g:ctrlp_open_new_file = 3
|
bgneal@0
|
270 <
|
bgneal@0
|
271
|
bgneal@0
|
272 *'g:ctrlp_max_history'*
|
bgneal@0
|
273 The maximum number of input strings you want |CtrlP| to remember. The default
|
bgneal@0
|
274 value mirrors Vim’s global |'history'| option: >
|
bgneal@0
|
275 let g:ctrlp_max_history = &history
|
bgneal@0
|
276 <
|
bgneal@0
|
277 Set to 0 to disable prompt’s history.
|
bgneal@0
|
278
|
bgneal@0
|
279 *'g:ctrlp_open_multi'*
|
bgneal@0
|
280 If non-zero, this will enable opening multiple files with <c-z> and <c-o>: >
|
bgneal@0
|
281 let g:ctrlp_open_multi = '1v'
|
bgneal@0
|
282 <
|
bgneal@0
|
283 For the number:
|
bgneal@0
|
284 If bigger than 1, it’ll be used as the maximum number of windows or tabs to
|
bgneal@0
|
285 create when opening the files (the rest will be hidden buffers). If is 1,
|
bgneal@0
|
286 <c-o> will open all files, each in a new window or new tab.
|
bgneal@0
|
287 For the letter:
|
bgneal@0
|
288 t - each in a tab
|
bgneal@0
|
289 h - each in a horizontal split
|
bgneal@0
|
290 v - each in a vertical split
|
bgneal@0
|
291
|
bgneal@0
|
292 *'g:ctrlp_dont_split'*
|
bgneal@0
|
293 When opening a file with <cr>, |CtrlP| avoids opening it in windows created by
|
bgneal@0
|
294 plugins, help and quickfix. Use this to setup some exceptions: >
|
bgneal@0
|
295 let g:ctrlp_dont_split = ''
|
bgneal@0
|
296 <
|
bgneal@0
|
297 Acceptable values are partial names or filetypes of the special buffers. Use
|
bgneal@0
|
298 |regexp| to specify the pattern. Example: >
|
bgneal@0
|
299 let g:ctrlp_dont_split = 'netrw\|help'
|
bgneal@0
|
300 <
|
bgneal@0
|
301
|
bgneal@0
|
302 *'g:ctrlp_follow_symlinks'*
|
bgneal@0
|
303 Set this to 1 to follow symbolic links when listing files: >
|
bgneal@0
|
304 let g:ctrlp_follow_symlinks = 0
|
bgneal@0
|
305 <
|
bgneal@0
|
306
|
bgneal@0
|
307 *'g:ctrlp_lazy_update'*
|
bgneal@0
|
308 Set this to 1 to enable the lazy-update feature: only update the match window
|
bgneal@0
|
309 after typing’s been stopped for a certain amount of time: >
|
bgneal@0
|
310 let g:ctrlp_lazy_update = 0
|
bgneal@0
|
311 <
|
bgneal@0
|
312 If is 1, update after 250ms. If bigger than 1, the number will be used as the
|
bgneal@0
|
313 delay time in milliseconds.
|
bgneal@0
|
314
|
bgneal@0
|
315 *'g:ctrlp_use_migemo'*
|
bgneal@0
|
316 Set this to 1 to use Migemo Pattern for Japanese filenames. Migemo Search only
|
bgneal@0
|
317 works in |regexp| mode. To split the pattern, separate words with space: >
|
bgneal@0
|
318 let g:ctrlp_use_migemo = 0
|
bgneal@0
|
319 <
|
bgneal@0
|
320
|
bgneal@0
|
321 ===============================================================================
|
bgneal@0
|
322 3. Commands *ctrlp-commands*
|
bgneal@0
|
323
|
bgneal@0
|
324 *:CtrlP*
|
bgneal@0
|
325 :CtrlP [starting-directory]
|
bgneal@0
|
326 Open |CtrlP| in find file mode.
|
bgneal@0
|
327
|
bgneal@0
|
328 If no argument is given, the value of |g:ctrlp_working_path_mode| will be
|
bgneal@0
|
329 used to determine the starting directory.
|
bgneal@0
|
330 You can use <tab> to auto-complete the [starting-directory] when typing it.
|
bgneal@0
|
331
|
bgneal@0
|
332 *:CtrlPBuffer*
|
bgneal@0
|
333 :CtrlPBuffer
|
bgneal@0
|
334 Open |CtrlP| in find buffer mode.
|
bgneal@0
|
335
|
bgneal@0
|
336 *:CtrlPMRU*
|
bgneal@0
|
337 :CtrlPMRU
|
bgneal@0
|
338 Open |CtrlP| in find Most-Recently-Used file mode.
|
bgneal@0
|
339
|
bgneal@0
|
340 *:ClearCtrlPCache*
|
bgneal@0
|
341 :ClearCtrlPCache
|
bgneal@0
|
342 Flush the cache for the current working directory. The same as pressing <F5>
|
bgneal@0
|
343 inside |CtrlP|.
|
bgneal@0
|
344
|
bgneal@0
|
345 *:ClearAllCtrlPCaches*
|
bgneal@0
|
346 :ClearAllCtrlPCaches
|
bgneal@0
|
347 Delete all the cache files saved in |ctrlp_cache_dir|.
|
bgneal@0
|
348
|
bgneal@0
|
349 *:ResetCtrlP*
|
bgneal@0
|
350 :ResetCtrlP
|
bgneal@0
|
351 Reset all options, take in new values of the option variables in section 2.
|
bgneal@0
|
352
|
bgneal@0
|
353 -------------------------------------------------------------------------------
|
bgneal@0
|
354 The following commands ignore the current value of |g:ctrlp_working_path_mode|:
|
bgneal@0
|
355
|
bgneal@0
|
356 :CtrlPCurWD *:CtrlPCurWD*
|
bgneal@0
|
357 This acts like |:CtrlP| with |path_mode| = 0
|
bgneal@0
|
358
|
bgneal@0
|
359 :CtrlPCurFile *:CtrlPCurFile*
|
bgneal@0
|
360 This acts like |:CtrlP| with |path_mode| = 1
|
bgneal@0
|
361
|
bgneal@0
|
362 :CtrlPRoot *:CtrlPRoot*
|
bgneal@0
|
363 This acts like |:CtrlP| with |path_mode| = 2
|
bgneal@0
|
364
|
bgneal@0
|
365 ===============================================================================
|
bgneal@0
|
366 4. Mappings *ctrlp-mappings*
|
bgneal@0
|
367
|
bgneal@0
|
368 *'ctrlp-<c-p>'*
|
bgneal@0
|
369 <c-p>
|
bgneal@0
|
370 Default |Normal| mode mapping to open the |CtrlP| prompt in find file mode.
|
bgneal@0
|
371
|
bgneal@0
|
372 Once inside the prompt:~
|
bgneal@0
|
373
|
bgneal@0
|
374 <c-r> *'ctrlp-fullregexp'*
|
bgneal@0
|
375 Toggle between the string mode (section 5.a & b) and full |regexp| mode.
|
bgneal@0
|
376 (note: in full |regexp| mode, the prompt’s base is 'r>>' instead of '>>>')
|
bgneal@0
|
377
|
bgneal@0
|
378 See also |input-formats| and |g:ctrlp_regexp_search|.
|
bgneal@0
|
379
|
bgneal@0
|
380 <c-d>
|
bgneal@0
|
381 Toggle between full path search and filename only search.
|
bgneal@0
|
382 (note: in filename mode, the prompt’s base is '>d>' instead of '>>>')
|
bgneal@0
|
383
|
bgneal@0
|
384 <c-f>, 'forward'
|
bgneal@0
|
385 <c-up>
|
bgneal@0
|
386 Scroll to the 'next' search mode in the sequence.
|
bgneal@0
|
387
|
bgneal@0
|
388 <c-b>, 'backward'
|
bgneal@0
|
389 <c-down>
|
bgneal@0
|
390 Scroll to the 'previous' search mode in the sequence.
|
bgneal@0
|
391
|
bgneal@0
|
392 <tab>
|
bgneal@0
|
393 Toggle the focus between the match window and the prompt.
|
bgneal@0
|
394
|
bgneal@0
|
395 <c-j>,
|
bgneal@0
|
396 <down>
|
bgneal@0
|
397 Move selection down
|
bgneal@0
|
398
|
bgneal@0
|
399 <c-k>,
|
bgneal@0
|
400 <up>
|
bgneal@0
|
401 Move selection up
|
bgneal@0
|
402
|
bgneal@0
|
403 <c-a>
|
bgneal@0
|
404 Move the cursor to the 'start' of the prompt
|
bgneal@0
|
405
|
bgneal@0
|
406 <c-e>
|
bgneal@0
|
407 Move the cursor to the 'end' of the prompt
|
bgneal@0
|
408
|
bgneal@0
|
409 <c-h>,
|
bgneal@0
|
410 <left>
|
bgneal@0
|
411 Move the cursor one character to the 'left'
|
bgneal@0
|
412
|
bgneal@0
|
413 <c-l>,
|
bgneal@0
|
414 <right>
|
bgneal@0
|
415 Move the cursor one character to the 'right'
|
bgneal@0
|
416
|
bgneal@0
|
417 <c-w>
|
bgneal@0
|
418 Delete a preceding inner word
|
bgneal@0
|
419
|
bgneal@0
|
420 <c-u>
|
bgneal@0
|
421 Clear the input field
|
bgneal@0
|
422
|
bgneal@0
|
423 <cr>
|
bgneal@0
|
424 Open selected file in the active window if possible.
|
bgneal@0
|
425
|
bgneal@0
|
426 <c-t>
|
bgneal@0
|
427 Open selected file in a new 'tab'
|
bgneal@0
|
428
|
bgneal@0
|
429 <c-v>
|
bgneal@0
|
430 Open selected file in a 'vertical' split
|
bgneal@0
|
431
|
bgneal@0
|
432 <c-cr>,
|
bgneal@0
|
433 <c-s>,
|
bgneal@0
|
434 <c-x>
|
bgneal@0
|
435 Open selected file in a 'horizontal' split
|
bgneal@0
|
436
|
bgneal@0
|
437 <c-y>
|
bgneal@0
|
438 Create a new file and its parent directories.
|
bgneal@0
|
439
|
bgneal@0
|
440 <c-n>
|
bgneal@0
|
441 Next string in the prompt’s history
|
bgneal@0
|
442
|
bgneal@0
|
443 <c-p>
|
bgneal@0
|
444 Previous string in the prompt’s history
|
bgneal@0
|
445
|
bgneal@0
|
446 <c-z>
|
bgneal@0
|
447 Mark/unmark a file to be opened with <c-o>.
|
bgneal@0
|
448
|
bgneal@0
|
449 <c-o>
|
bgneal@0
|
450 Open files marked by <c-z>.
|
bgneal@0
|
451
|
bgneal@0
|
452 <F5>
|
bgneal@0
|
453 - Refresh the match window and purge the cache for the current directory.
|
bgneal@0
|
454 - Remove deleted files from MRU list.
|
bgneal@0
|
455
|
bgneal@0
|
456 <F7>
|
bgneal@0
|
457 Clear MRU list.
|
bgneal@0
|
458
|
bgneal@0
|
459 <esc>,
|
bgneal@0
|
460 <c-c>,
|
bgneal@0
|
461 <c-g>
|
bgneal@0
|
462 Exit |CtrlP|. <c-c> can also be used to stop the file scan.
|
bgneal@0
|
463
|
bgneal@0
|
464 Choose your own mappings with |g:ctrlp_prompt_mappings|.
|
bgneal@0
|
465
|
bgneal@0
|
466 When inside the match window (press <tab> to switch):~
|
bgneal@0
|
467
|
bgneal@0
|
468 a-z
|
bgneal@0
|
469 0-9
|
bgneal@0
|
470 ~^-=;`',.+!@#$%&_(){}[]
|
bgneal@0
|
471 Cycle through the lines with the first letter (of paths or filenames) that
|
bgneal@0
|
472 matches that key.
|
bgneal@0
|
473
|
bgneal@0
|
474 ===============================================================================
|
bgneal@0
|
475 5. Input Formats *ctrlp-input-formats*
|
bgneal@0
|
476
|
bgneal@0
|
477 Formats for inputting in the prompt:~
|
bgneal@0
|
478
|
bgneal@0
|
479 a) Simple string.
|
bgneal@0
|
480 e.g. 'abc' is understood internally as 'a[^a]\{-}b[^b]\{-}c'
|
bgneal@0
|
481
|
bgneal@0
|
482 b) Vim |regexp|. If the input string contains '*' or '|', it’ll be treated as
|
bgneal@0
|
483 a Vim’s |regexp| |pattern| without any modification.
|
bgneal@0
|
484 e.g. 'abc\d*efg' will be read as 'abc\d*efg'.
|
bgneal@0
|
485
|
bgneal@0
|
486 See also |ctrlp-fullregexp| (key map) and |g:ctrlp_regexp_search| (option).
|
bgneal@0
|
487
|
bgneal@0
|
488 c) End the string with a colon ':' followed by a Vim command to execute that
|
bgneal@0
|
489 command after opening the file. If you need to use ':' in the command,
|
bgneal@0
|
490 escape it with a backslash: '\:'.
|
bgneal@0
|
491 e.g. 'abc:45' will open the selected file and jump to line 45.
|
bgneal@0
|
492 'abc:/my\:function' will open the selected file and jump to the first
|
bgneal@0
|
493 instance of 'my:function'.
|
bgneal@0
|
494 'abc:+setf\ myfiletype|50' will open the selected file and set its
|
bgneal@0
|
495 filetype to 'myfiletype' then jump to line 50.
|
bgneal@0
|
496
|
bgneal@0
|
497 See also Vim’s |++opt| and |+cmd|.
|
bgneal@0
|
498
|
bgneal@0
|
499 d) Type exactly two dots '..' at the start of the prompt and press enter to go
|
bgneal@0
|
500 backward in the directory tree by 1 level. If the parent directory is
|
bgneal@0
|
501 large, this might be slow.
|
bgneal@0
|
502
|
bgneal@3
|
503 e) Similarly, submit '/' or '\' to find and go to the project’s root. If the
|
bgneal@0
|
504 project is large, using a VCS listing command to look for files might help
|
bgneal@0
|
505 speeding up the intial scan (see |g:ctrlp_user_command| for more details).
|
bgneal@0
|
506
|
bgneal@0
|
507 f) Type the name of a non-existent file and press <c-y> to create it.
|
bgneal@0
|
508 e.g. 'parentdir/file.txt' will create a directory named 'parentdir' as well
|
bgneal@0
|
509 as 'file.txt'.
|
bgneal@0
|
510 Use '\' in place of '/' on Windows (if |'ssl'| is not set).
|
bgneal@0
|
511
|
bgneal@0
|
512 g) Submit ? to open this help file.
|
bgneal@0
|
513
|
bgneal@0
|
514 ===============================================================================
|
bgneal@0
|
515 6. Extensions *g:ctrlp-extensions*
|
bgneal@0
|
516
|
bgneal@0
|
517 Extensions are optional. To enable an extension, add its name to the variable
|
bgneal@0
|
518 g:ctrlp_extensions: >
|
bgneal@3
|
519 let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir']
|
bgneal@0
|
520 <
|
bgneal@0
|
521 The order of the items will be the order they appear on the statusline and when
|
bgneal@0
|
522 using <c-f>, <c-b>.
|
bgneal@0
|
523
|
bgneal@0
|
524 Available extensions:~
|
bgneal@0
|
525
|
bgneal@0
|
526 *:CtrlPTag*
|
bgneal@0
|
527 * Tag mode:~
|
bgneal@0
|
528 - Name: 'tag'
|
bgneal@0
|
529 - Command: ':CtrlPTag'
|
bgneal@0
|
530 - Search for a tag within a generated central tags file, and jump to the
|
bgneal@0
|
531 definition. Use the Vim’s option |'tags'| to specify the names and the
|
bgneal@0
|
532 locations of the tags file(s). Example: `set tags+=tags/help,doc/tags`
|
bgneal@0
|
533
|
bgneal@3
|
534 *:CtrlPBufTag*
|
bgneal@3
|
535 * Buffer Tag mode:~
|
bgneal@3
|
536 - Name: 'buffertag'
|
bgneal@3
|
537 - Command: ':CtrlPBufTag'
|
bgneal@3
|
538 - Search for a tag within the current buffer and jump to the definition.
|
bgneal@3
|
539 Requires |exuberant_ctags|.
|
bgneal@3
|
540
|
bgneal@0
|
541 *:CtrlPQuickfix*
|
bgneal@0
|
542 * Quickfix mode:~
|
bgneal@0
|
543 - Name: 'quickfix'
|
bgneal@0
|
544 - Command: ':CtrlPQuickfix'
|
bgneal@0
|
545 - Search for an entry in the current quickfix errors and jump to it.
|
bgneal@0
|
546
|
bgneal@0
|
547 *:CtrlPDir*
|
bgneal@0
|
548 * Directory mode:~
|
bgneal@0
|
549 - Name: 'dir'
|
bgneal@0
|
550 - Command: ':CtrlPDir'
|
bgneal@0
|
551 - Search for a directory and change the working directory to it.
|
bgneal@0
|
552 - Mappings:
|
bgneal@0
|
553 + <cr> change the local working directory for |CtrlP| and keep it open.
|
bgneal@0
|
554 + <c-t> change the global working directory (exit).
|
bgneal@0
|
555 + <c-v> change the local working directory for the current window (exit).
|
bgneal@0
|
556 + <c-x> change the global working directory to |CtrlP|’s current local
|
bgneal@0
|
557 working directory (exit).
|
bgneal@0
|
558
|
bgneal@3
|
559 -------------------------------------------------------------------------------
|
bgneal@3
|
560 Buffer Tag mode options:~
|
bgneal@3
|
561
|
bgneal@3
|
562 *'g:ctrlp_buftag_ctags_bin'*
|
bgneal@3
|
563 If ctags isn’t in your $PATH, use this to set its location: >
|
bgneal@3
|
564 let g:ctrlp_buftag_ctags_bin = ''
|
bgneal@3
|
565 <
|
bgneal@3
|
566
|
bgneal@3
|
567 *'g:ctrlp_buftag_systemenc'*
|
bgneal@3
|
568 Match this with your OS’s encoding (not Vim’s). The default value mirrors Vim’s
|
bgneal@3
|
569 global |'encoding'| option: >
|
bgneal@3
|
570 let g:ctrlp_buftag_systemenc = &encoding
|
bgneal@3
|
571 <
|
bgneal@3
|
572
|
bgneal@3
|
573 *'g:ctrlp_buftag_types'*
|
bgneal@3
|
574 Use this to set the arguments for ctags, jsctags... for a given filetype: >
|
bgneal@3
|
575 let g:ctrlp_buftag_types = ''
|
bgneal@3
|
576 <
|
bgneal@3
|
577 Examples: >
|
bgneal@3
|
578 let g:ctrlp_buftag_types = {
|
bgneal@3
|
579 \ 'erlang' : '--language-force=erlang --erlang-types=drmf',
|
bgneal@3
|
580 \ 'javascript' : {
|
bgneal@3
|
581 \ 'bin': 'jsctags',
|
bgneal@3
|
582 \ 'args': '-f -',
|
bgneal@3
|
583 \ },
|
bgneal@3
|
584 \ }
|
bgneal@3
|
585 <
|
bgneal@3
|
586
|
bgneal@0
|
587 ===============================================================================
|
bgneal@0
|
588 EXTENDING *ctrlp-extending*
|
bgneal@0
|
589
|
bgneal@0
|
590 Extending |CtrlP| is very simple. Simply create a vim file following a short
|
bgneal@0
|
591 guidelines, place it in autoload/ctrlp/ and add its name to your .vimrc.
|
bgneal@0
|
592
|
bgneal@0
|
593 To see how it works, get the sample.vim from the extensions branch on the main
|
bgneal@0
|
594 git repository (https://github.com/kien/ctrlp.vim/tree/extensions), and place
|
bgneal@0
|
595 it along with the parent directories somewhere in your runtimepath. Then put
|
bgneal@0
|
596 this into your .vimrc: >
|
bgneal@0
|
597 let g:ctrlp_extensions = ['sample']
|
bgneal@0
|
598 <
|
bgneal@0
|
599 A new search type will show up the next time you open |CtrlP|.
|
bgneal@0
|
600
|
bgneal@0
|
601 For more details, check out the comments inside sample.vim.~
|
bgneal@0
|
602
|
bgneal@0
|
603 ===============================================================================
|
bgneal@0
|
604 CREDITS *ctrlp-credits*
|
bgneal@0
|
605
|
bgneal@0
|
606 Developed by Kien Nguyen <github.com/kien>, initially based on the Command-T
|
bgneal@0
|
607 and the LustyExplorer plugins. No code was taken from these plugins, but I did
|
bgneal@0
|
608 clone the majority of their (awesome) interfaces and the way they work.
|
bgneal@0
|
609
|
bgneal@0
|
610 This was originally written as a module for a would-be larger plugin called
|
bgneal@0
|
611 AutoDoc.vim which I’ve stopped developing because of lost of interest. I really
|
bgneal@0
|
612 liked the way Command-T and LustyExplorer deal with user’s input, so I wrote a
|
bgneal@0
|
613 pure Vimscript version of their prompt window, intended to use it for the
|
bgneal@0
|
614 aforementioned plugin.
|
bgneal@0
|
615
|
bgneal@0
|
616 Homepage: http://kien.github.com/ctrlp.vim
|
bgneal@0
|
617 Git repository: https://github.com/kien/ctrlp.vim
|
bgneal@0
|
618 Mercurial repository: https://bitbucket.org/kien/ctrlp.vim
|
bgneal@0
|
619
|
bgneal@0
|
620 ===============================================================================
|
bgneal@0
|
621 THANKS *ctrlp-thanks*
|
bgneal@0
|
622
|
bgneal@0
|
623 Thanks to everyone that has submitted ideas, bug reports or helped debugging on
|
bgneal@0
|
624 gibhub, bitbucket, and through email.
|
bgneal@0
|
625
|
bgneal@0
|
626 Special thanks:~
|
bgneal@0
|
627
|
bgneal@0
|
628 * Woojong Koh <github.com/wjkoh>
|
bgneal@0
|
629 Forked and suggested the support for VCS listing commands.
|
bgneal@0
|
630
|
bgneal@0
|
631 * Yasuhiro Matsumoto <github.com/mattn>
|
bgneal@0
|
632 Added option to use Migemo for Japanese language.
|
bgneal@0
|
633
|
bgneal@0
|
634 ===============================================================================
|
bgneal@0
|
635 CHANGELOG *ctrlp-changelog*
|
bgneal@0
|
636
|
bgneal@3
|
637 + New feature: Buffer Tag extension.
|
bgneal@3
|
638 + New command: |:CtrlPBufTag|.
|
bgneal@3
|
639 + New options: |g:ctrlp_cmd|,
|
bgneal@3
|
640 |g:ctrlp_custom_ignore|
|
bgneal@3
|
641
|
bgneal@0
|
642 Before 2011/11/30~
|
bgneal@0
|
643
|
bgneal@0
|
644 + New features: Tag, Quickfix and Directory extensions.
|
bgneal@0
|
645 + New commands: |:CtrlPTag|, |:CtrlPQuickfix|, |:CtrlPDir|.
|
bgneal@0
|
646 + New options: |g:ctrlp_use_migemo|,
|
bgneal@0
|
647 |g:ctrlp_lazy_update|,
|
bgneal@0
|
648 |g:ctrlp_follow_symlinks|
|
bgneal@0
|
649
|
bgneal@0
|
650 Before 2011/11/13~
|
bgneal@0
|
651
|
bgneal@0
|
652 + New special input: '/' and '\' find root (section 5.e)
|
bgneal@0
|
653 + Remove ctrlp#SetWorkingPath().
|
bgneal@0
|
654 + Remove |g:ctrlp_mru_files|, make MRU permanent.
|
bgneal@0
|
655 + Extend |g:ctrlp_open_multi|, add new ways to open files.
|
bgneal@0
|
656 + New option: |g:ctrlp_dont_split|,
|
bgneal@0
|
657 |g:ctrlp_mruf_case_sensitive|
|
bgneal@0
|
658
|
bgneal@0
|
659 Before 2011/10/30~
|
bgneal@0
|
660
|
bgneal@0
|
661 + New feature: Support for custom extensions.
|
bgneal@0
|
662 <F5> also removes non-existent files from MRU list.
|
bgneal@0
|
663 + New option: |g:ctrlp_jump_to_buffer|
|
bgneal@0
|
664
|
bgneal@0
|
665 Before 2011/10/12~
|
bgneal@0
|
666
|
bgneal@0
|
667 + New features: Open multiple files.
|
bgneal@0
|
668 Pass Vim’s |++opt| and |+cmd| to the opening file
|
bgneal@0
|
669 (section 5.c)
|
bgneal@0
|
670 Auto-complete each dir for |:CtrlP| [starting-directory]
|
bgneal@0
|
671 + New mappings: <c-z> mark/unmark a file to be opened with <c-o>.
|
bgneal@0
|
672 <c-o> open all marked files.
|
bgneal@0
|
673 + New option: |g:ctrlp_open_multi|
|
bgneal@0
|
674 + Remove |g:ctrlp_persistent_input|, |g:ctrlp_live_update| and <c-^>.
|
bgneal@0
|
675
|
bgneal@0
|
676 Before 2011/09/29~
|
bgneal@0
|
677
|
bgneal@0
|
678 + New mappings: <c-n>, <c-p> next/prev string in the input history.
|
bgneal@0
|
679 <c-y> create a new file and its parent dirs.
|
bgneal@0
|
680 + New options: |g:ctrlp_open_new_file|,
|
bgneal@0
|
681 |g:ctrlp_max_history|
|
bgneal@0
|
682 + Added a new open-in-horizontal-split mapping: <c-x>
|
bgneal@0
|
683
|
bgneal@0
|
684 Before 2011/09/19~
|
bgneal@0
|
685
|
bgneal@0
|
686 + New command: |ResetCtrlP|
|
bgneal@0
|
687 + New options: |g:ctrlp_max_files|,
|
bgneal@0
|
688 |g:ctrlp_max_depth|,
|
bgneal@0
|
689 |g:ctrlp_live_update|
|
bgneal@0
|
690 + New mapping: <c-^>
|
bgneal@0
|
691
|
bgneal@0
|
692 Before 2011/09/12~
|
bgneal@0
|
693
|
bgneal@0
|
694 + Ability to cycle through matched lines in the match window.
|
bgneal@0
|
695 + Extend the behavior of |g:ctrlp_persistent_input|
|
bgneal@0
|
696 + Extend the behavior of |:CtrlP|
|
bgneal@0
|
697 + New options: |g:ctrlp_dotfiles|,
|
bgneal@0
|
698 |g:ctrlp_clear_cache_on_exit|,
|
bgneal@0
|
699 |g:ctrlp_highlight_match|,
|
bgneal@0
|
700 |g:ctrlp_user_command|
|
bgneal@0
|
701 + New special input: '..' (section 5.d)
|
bgneal@0
|
702 + New mapping: <F5>.
|
bgneal@0
|
703 + New commands: |:CtrlPCurWD|,
|
bgneal@0
|
704 |:CtrlPCurFile|,
|
bgneal@0
|
705 |:CtrlPRoot|
|
bgneal@0
|
706
|
bgneal@0
|
707 + New feature: Search in most recently used (MRU) files
|
bgneal@0
|
708 + New mapping: <c-b>.
|
bgneal@0
|
709 + Extended the behavior of <c-f>.
|
bgneal@0
|
710 + New options: |g:ctrlp_mru_files|,
|
bgneal@0
|
711 |g:ctrlp_mruf_max|,
|
bgneal@0
|
712 |g:ctrlp_mruf_exclude|,
|
bgneal@0
|
713 |g:ctrlp_mruf_include|
|
bgneal@0
|
714 + New command: |:CtrlPMRUFiles|
|
bgneal@0
|
715
|
bgneal@0
|
716 First public release: 2011/09/06~
|
bgneal@0
|
717
|
bgneal@0
|
718 ===============================================================================
|
bgneal@0
|
719 vim:ft=help:et:ts=2:sw=2:sts=2:norl
|