Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 83 lines (61 sloc) 2.621 kb
850c742 @kien small edit
authored
1 # ctrlp.vim
d18767e @kien mention`wildignore`
authored
2 Full path fuzzy __file__, __buffer__ and __MRU__ file finder for Vim.
f823efe @kien some small edits
authored
3
4ca1ab9 @kien some small changes
authored
4 * Written in pure Vimscript for MacVim and Vim 7.0+.
c8d02c5 @kien Enhancements for prompt history and :CtrlP [start-dir]
authored
5 * Full support for Vim’s regexp as search pattern.
6 * Built-in Most Recently Used (MRU) files monitoring.
7 * Built-in project’s root finder.
b6f1539 @kien various changes
authored
8
9 ![ctrlp][1]
10
11 ## Basic Usage
12 * Press `<c-p>` or run `:CtrlP` to invoke CtrlP.
1a2c3ee @kien Open Multiple Files
authored
13
14 Once CtrlP is open:
15
16 * Press `<c-f>` and `<c-b>` to switch between find file, buffer, and MRU file modes.
17 * Press `<c-d>` to switch to filename only search instead of full path.
c360f2d @kien sorting and escaping
authored
18 * Use `*` or `|` in the prompt to submit the string as a Vim’s regexp pattern.
1a2c3ee @kien Open Multiple Files
authored
19 * Or press `<c-r>` to switch to full regexp search mode.
20 * End the input string with a colon `:` followed by a command to execute after opening the file.
21 e.g. `abc:45` will open the file matched the pattern and jump to line 45.
df2622f @kien update readme with new `..` input
authored
22 * Submit two dots `..` as the input string to go backward the directory tree by 1 level.
1a2c3ee @kien Open Multiple Files
authored
23 * Use `<c-y>` to create a new file and its parent dirs.
6ee4410 @kien Improve Open Multiple Files
authored
24 * Use `<c-z>` to mark/unmark files and `<c-o>` to open them.
b6f1539 @kien various changes
authored
25
4ca1ab9 @kien some small changes
authored
26 ## Basic Options
27 * Change the mapping to invoke CtrlP:
bdfb4c5 @kien should be good now
authored
28
b6f1539 @kien various changes
authored
29 ```vim
30 let g:ctrlp_map = '<c-p>'
31 ```
bdfb4c5 @kien should be good now
authored
32
d17beb0 @kien bug fix and clean up
authored
33 * When CtrlP is invoked, it automatically sets the working directory according to this variable:
cbad949 @kien small edit
authored
34
b6f1539 @kien various changes
authored
35 ```vim
36 let g:ctrlp_working_path_mode = 1
37 ```
cbad949 @kien small edit
authored
38
ba935d9 @kien fix readme
authored
39 0 - don’t manage working directory.
4ca1ab9 @kien some small changes
authored
40 1 - the parent directory of the current file.
fbcfec2 @kien New feature: search most recently opened files
authored
41 2 - the nearest ancestor that contains one of these directories or files:
cbad949 @kien small edit
authored
42
4ca1ab9 @kien some small changes
authored
43 .git/
44 .hg/
45 .bzr/
46 _darcs/
47 root.dir
48 .vimprojects
cbad949 @kien small edit
authored
49
d82dfe8 @kien fix readme
authored
50 * You can also use the set-working-directory functionality above outside of CtrlP
bdfb4c5 @kien should be good now
authored
51 by adding the following line to your vimrc.
52 The parameter is the same (0, 1 or 2):
d5ee279 @kien small edit
authored
53
b6f1539 @kien various changes
authored
54 ```vim
55 au BufEnter * cal ctrlp#SetWorkingPath(2)
56 ```
57
fbcfec2 @kien New feature: search most recently opened files
authored
58 * Enable/Disable Most Recently Used files monitoring and its functionalities:
59
60 ```vim
61 let g:ctrlp_mru_files = 1
62 ```
63
d18767e @kien mention`wildignore`
authored
64 * If you want to exclude directories or files from the search, you can use the Vim’s option `wildignore`.
65 e.g. Just have something like this in your vimrc:
66
67 ```vim
e311264 @kien update docs on using wildignore
authored
68 set wildignore+=*/.git/*,*/.hg/*,*/.svn/* " for Linux/MacOSX
69 set wildignore+=.git\*,.hg\*,.svn\* " for Windows
d18767e @kien mention`wildignore`
authored
70 ```
71
6ee4410 @kien Improve Open Multiple Files
authored
72 * Use a custom file listing command with:
73
74 ```vim
75 let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux
76 let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows
77 ```
78
bfd9800 @kien Various changes:
authored
79 _Check [the docs][2] for more mappings, commands and options._
b6f1539 @kien various changes
authored
80
1a2c3ee @kien Open Multiple Files
authored
81 [1]: http://i.imgur.com/3rtLt.png
bfd9800 @kien Various changes:
authored
82 [2]: https://github.com/kien/ctrlp.vim/blob/master/doc/ctrlp.txt
Something went wrong with that request. Please try again.