bgneal@7: # ctrlp.vim bgneal@7: Full path fuzzy __file__, __buffer__, __mru__ and __tag__ finder for Vim. bgneal@7: bgneal@7: * Written in pure Vimscript for MacVim and Vim 7.0+. bgneal@7: * Full support for Vim’s regexp as search pattern. bgneal@7: * Built-in Most Recently Used (MRU) files monitoring. bgneal@7: * Built-in project’s root finder. bgneal@7: * Open Multiple Files. bgneal@7: * [Extensible][3]. bgneal@7: bgneal@7: ![ctrlp][1] bgneal@7: bgneal@7: ## Basic Usage bgneal@7: * Press `` or run `:CtrlP` to invoke CtrlP in find file mode. bgneal@7: * Run `:CtrlPBuffer` or `:CtrlPMRU` to invoke CtrlP in buffer or MRU mode. bgneal@7: * Or run `:CtrlPMixed` to search in a mix of files, buffers and MRU files. bgneal@7: bgneal@7: Once CtrlP is open: bgneal@7: bgneal@7: * Press `` and `` to switch between find file, buffer, and MRU file bgneal@7: modes. bgneal@7: * Press `` to switch to filename only search instead of full path. bgneal@7: * Press `` to switch to regexp mode. bgneal@7: * Press `` to purge the cache for the current directory and get new files. bgneal@7: * End the input string with a colon `:` followed by a command to execute after bgneal@7: opening the file. bgneal@7: e.g. `abc:45` will open the file matched the pattern and jump to line 45. bgneal@7: * Submit two dots `..` as the input string to go backward the directory tree by bgneal@7: 1 level. bgneal@7: * Use `` to create a new file and its parent dirs. bgneal@7: * Use `` to mark/unmark multiple files and `` to open them. bgneal@7: bgneal@7: ## Basic Options bgneal@7: * Change the mapping to invoke CtrlP: bgneal@7: bgneal@7: ```vim bgneal@7: let g:ctrlp_map = '' bgneal@7: ``` bgneal@7: bgneal@7: * When CtrlP is invoked, it automatically sets its local working directory bgneal@7: according to this variable: bgneal@7: bgneal@7: ```vim bgneal@7: let g:ctrlp_working_path_mode = 2 bgneal@7: ``` bgneal@7: bgneal@7: 0 - don’t manage working directory. bgneal@7: 1 - the parent directory of the current file. bgneal@7: 2 - the nearest ancestor that contains one of these directories or files: bgneal@7: `.git/` `.hg/` `.svn/` `.bzr/` `_darcs/` bgneal@7: bgneal@7: * If you want to exclude directories or files from the search, use the Vim’s bgneal@7: option `wildignore` and/or the option `g:ctrlp_custom_ignore`. Examples: bgneal@7: bgneal@7: ```vim bgneal@7: set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux bgneal@7: set wildignore+=tmp\*,*.swp,*.zip,*.exe " Windows bgneal@7: bgneal@7: let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$' bgneal@7: let g:ctrlp_custom_ignore = { bgneal@7: \ 'dir': '\.git$\|\.hg$\|\.svn$', bgneal@7: \ 'file': '\.exe$\|\.so$\|\.dll$', bgneal@7: \ 'link': 'some_bad_symbolic_links', bgneal@7: \ } bgneal@7: ``` bgneal@7: bgneal@7: * Use a custom file listing command with: bgneal@7: bgneal@7: ```vim bgneal@7: let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux bgneal@7: let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows bgneal@7: ``` bgneal@7: bgneal@7: _Check [the docs][2] for more mappings, commands and options._ bgneal@7: bgneal@7: [1]: http://i.imgur.com/yIynr.png bgneal@7: [2]: https://github.com/kien/ctrlp.vim/blob/master/doc/ctrlp.txt bgneal@7: [3]: https://github.com/kien/ctrlp.vim/tree/extensions