Skip to content
Newer
Older
100644 74 lines (55 sloc) 2.46 KB
850c742 @kien small edit
kien authored Sep 6, 2011
1 # ctrlp.vim
d18767e @kien mention`wildignore`
kien authored Sep 12, 2011
2 Full path fuzzy __file__, __buffer__ and __MRU__ file finder for Vim.
f823efe @kien some small edits
kien authored Sep 6, 2011
3
4ca1ab9 @kien some small changes
kien authored Sep 5, 2011
4 * Written in pure Vimscript for MacVim and Vim 7.0+.
f823efe @kien some small edits
kien authored Sep 5, 2011
5 * Has full support for Vim’s regexp as search pattern, and more.
1c9a615 @kien udate docs
kien authored Sep 7, 2011
6 * Can also find file in most recently used files.
b6f1539 @kien various changes
kien authored Aug 22, 2011
7
8 ![ctrlp][1]
9
10 ## Basic Usage
11 * Press `<c-p>` or run `:CtrlP` to invoke CtrlP.
d17beb0 @kien bug fix and clean up
kien authored Sep 8, 2011
12 * Press `<c-f>` and `<c-b>` while CtrlP is open to switch between find file, find buffer, and find MRU file modes.
ba935d9 @kien fix readme
kien authored Sep 6, 2011
13 * Ever remember only a file’s name but not where it is? Press `<c-d>` while CtrlP is open to switch to filename only search.
14 * Use `*` `?` `^` `+` or `|` in the prompt to submit the string as a Vim’s regexp pattern.
d82dfe8 @kien fix readme
kien authored Sep 6, 2011
15 * Or press `<c-r>` while CtrlP is open to switch to full regexp search mode.
d17beb0 @kien bug fix and clean up
kien authored Sep 7, 2011
16 * End the input string with a colon `:` followed with a number to jump to that line in the selected file.
4ca1ab9 @kien some small changes
kien authored Sep 5, 2011
17 e.g. `abc:45` to open the file matched the pattern and jump to line 45.
df2622f @kien update readme with new `..` input
kien authored Sep 9, 2011
18 * Submit two dots `..` as the input string to go backward the directory tree by 1 level.
b6f1539 @kien various changes
kien authored Aug 22, 2011
19
4ca1ab9 @kien some small changes
kien authored Sep 5, 2011
20 _Screenshot: filename only mode with the match window focused._
21 ![ctrlp filename mode, match window focused][2]
b6f1539 @kien various changes
kien authored Aug 22, 2011
22
4ca1ab9 @kien some small changes
kien authored Sep 5, 2011
23 ## Basic Options
24 * Change the mapping to invoke CtrlP:
bdfb4c5 @kien should be good now
kien authored Sep 6, 2011
25
b6f1539 @kien various changes
kien authored Aug 22, 2011
26 ```vim
27 let g:ctrlp_map = '<c-p>'
28 ```
bdfb4c5 @kien should be good now
kien authored Sep 6, 2011
29
d17beb0 @kien bug fix and clean up
kien authored Sep 7, 2011
30 * When CtrlP is invoked, it automatically sets the working directory according to this variable:
cbad949 @kien small edit
kien authored Sep 6, 2011
31
b6f1539 @kien various changes
kien authored Aug 22, 2011
32 ```vim
33 let g:ctrlp_working_path_mode = 1
34 ```
cbad949 @kien small edit
kien authored Sep 5, 2011
35
ba935d9 @kien fix readme
kien authored Sep 6, 2011
36 0 - don’t manage working directory.
4ca1ab9 @kien some small changes
kien authored Sep 5, 2011
37 1 - the parent directory of the current file.
fbcfec2 @kien New feature: search most recently opened files
kien authored Sep 7, 2011
38 2 - the nearest ancestor that contains one of these directories or files:
cbad949 @kien small edit
kien authored Sep 5, 2011
39
4ca1ab9 @kien some small changes
kien authored Sep 5, 2011
40 .git/
41 .hg/
42 .bzr/
43 _darcs/
44 root.dir
45 .vimprojects
cbad949 @kien small edit
kien authored Sep 5, 2011
46
d82dfe8 @kien fix readme
kien authored Sep 6, 2011
47 * You can also use the set-working-directory functionality above outside of CtrlP
bdfb4c5 @kien should be good now
kien authored Sep 6, 2011
48 by adding the following line to your vimrc.
49 The parameter is the same (0, 1 or 2):
d5ee279 @kien small edit
kien authored Sep 6, 2011
50
b6f1539 @kien various changes
kien authored Aug 22, 2011
51 ```vim
52 au BufEnter * cal ctrlp#SetWorkingPath(2)
53 ```
54
fbcfec2 @kien New feature: search most recently opened files
kien authored Sep 7, 2011
55 * Enable/Disable Most Recently Used files monitoring and its functionalities:
56
57 ```vim
58 let g:ctrlp_mru_files = 1
59 ```
60
d18767e @kien mention`wildignore`
kien authored Sep 11, 2011
61 * If you want to exclude directories or files from the search, you can use the Vim’s option `wildignore`.
62 e.g. Just have something like this in your vimrc:
63
64 ```vim
65 set wildignore+=.git/*,.hg/*,.svn/* " for Linux/MacOSX
66 set wildignore+=.git\*,.hg\*,.svn\* " for Windows
67 ```
68
cbad949 @kien small edit
kien authored Sep 5, 2011
69 _Check [the docs][3] for more mappings, commands and options._
b6f1539 @kien various changes
kien authored Aug 22, 2011
70
df2622f @kien update readme with new `..` input
kien authored Sep 9, 2011
71 [1]: http://i.imgur.com/Gfntl.png
4daf165 @kien fix images
kien authored Sep 6, 2011
72 [2]: http://i.imgur.com/MyRIv.png
cbad949 @kien small edit
kien authored Sep 5, 2011
73 [3]: https://github.com/kien/ctrlp.vim/blob/master/doc/ctrlp.txt
Something went wrong with that request. Please try again.