Update docs

This commit is contained in:
Kien N 2012-03-03 22:31:50 +07:00
parent fcd20d1c94
commit 8dde6d0f7c
5 changed files with 31 additions and 27 deletions

View File

@ -1164,6 +1164,12 @@ fu! ctrlp#setdir(path, ...)
let cmd = a:0 ? a:1 : 'lc!'
sil! exe cmd ctrlp#fnesc(a:path)
endf
fu! ctrlp#setlcdir()
if exists('*haslocaldir')
cal ctrlp#setdir(getcwd(), haslocaldir() ? 'lc!' : 'cd!')
en
endf
" Highlighting {{{2
fu! s:syntax()
for [ke, va] in items(s:hlgrps) | if !hlexists('CtrlP'.ke)
@ -1430,8 +1436,8 @@ fu! s:openfile(cmd, fid, tail, ...)
if !empty(a:tail) || j2l
sil! norm! zvzz
en
if exists('*haslocaldir') && cmd != 'bad'
cal ctrlp#setdir(getcwd(), haslocaldir() ? 'lc!' : 'cd!')
if cmd != 'bad'
cal ctrlp#setlcdir()
en
endf

View File

@ -48,6 +48,7 @@ fu! ctrlp#quickfix#accept(mode, str)
exe cmd ctrlp#fnesc(filpath)
cal cursor(items[2], items[3])
sil! norm! zvzz
cal ctrlp#setlcdir()
endf
fu! ctrlp#quickfix#id()

View File

@ -93,6 +93,7 @@ fu! ctrlp#tag#accept(mode, str)
el
exe cmd tg
en
cal ctrlp#setlcdir()
endf
fu! ctrlp#tag#id()

View File

@ -87,6 +87,17 @@ When opening a file with <cr> or <c-t>, if the files already opened somewhere
2 - jump tab as well if the buffers opened in another tab.
0 - disable this feature.
*'g:ctrlp_reuse_window'*
When opening a file with <cr>, |CtrlP| avoids opening it in windows created by
plugins, help and quickfix. Use this to setup some exceptions: >
let g:ctrlp_reuse_window = 'netrw'
<
Acceptable values are partial names or filetypes of the special buffers. Use
|regexp| to specify the pattern.
Example: >
let g:ctrlp_reuse_window = 'netrw\|help\|quickfix'
<
*'g:ctrlp_working_path_mode'*
When starting up, |CtrlP| sets its local working directory according to this
variable: >
@ -224,9 +235,9 @@ Examples: >
Note #1: the `*/` in front of each directory glob is required.
Note #2: |wildignore| influences the result of |expand()|, |globpath()| and
|glob()| which many plugins use to find stuff on the system (e.g. fugitive.vim
looks for .git/, some other plugins look for external .exe tools on Windows).
So be a little mindful of what you put in your |wildignore|.
|glob()| which many plugins use to find stuff on the system (e.g. VCS related
plugins look for .git/, .hg/,... some other plugins look for external *.exe
tools on Windows). So be a little mindful of what you put in your |wildignore|.
*'g:ctrlp_custom_ignore'*
In addition to |'wildignore'|, use this for files and directories you want only
@ -345,17 +356,6 @@ Pressing <c-o> or <c-y> will then prompt for a keypress. The key can be:
Any other key - use the behavior specified with |g:ctrlp_open_new_file| and
|g:ctrlp_open_multiple_files|.
*'g:ctrlp_reuse_window'*
When opening a file with <cr>, |CtrlP| avoids opening it in windows created by
plugins, help and quickfix. Use this to setup some exceptions: >
let g:ctrlp_reuse_window = 'netrw'
<
Acceptable values are partial names or filetypes of the special buffers. Use
|regexp| to specify the pattern.
Example: >
let g:ctrlp_reuse_window = 'netrw\|help\|quickfix'
<
*'g:ctrlp_follow_symlinks'*
Set this to 1 to follow symbolic links when listing files: >
let g:ctrlp_follow_symlinks = 0

View File

@ -47,18 +47,14 @@ according to this variable:
0 - dont manage working directory.
1 - the parent directory of the current file.
2 - the nearest ancestor that contains one of these directories or files:
`.git/` `.hg/` `.svn/` `.bzr/` `_darcs/`
.git/
.hg/
.bzr/
_darcs/
* If you want to exclude directories or files from the search, you can use the
Vims option `wildignore` and/or the option `g:ctrlp_custom_ignore`. Examples:
* If you want to exclude directories or files from the search, use the Vims
option `wildignore` and/or the option `g:ctrlp_custom_ignore`. Examples:
```vim
set wildignore+=*/.git/*,*/.hg/*,*/.svn/* " for Linux/MacOSX
set wildignore+=.git\*,.hg\*,.svn\* " for Windows
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
set wildignore+=tmp\*,*.swp,*.zip,*.exe " Windows
let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$'
let g:ctrlp_custom_ignore = {
@ -71,8 +67,8 @@ Vims option `wildignore` and/or the option `g:ctrlp_custom_ignore`. Examples:
* Use a custom file listing command with:
```vim
let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux
let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows
let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux
let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows
```
_Check [the docs][2] for more mappings, commands and options._