Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kien committed Mar 3, 2012
1 parent fcd20d1 commit 8dde6d0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 27 deletions.
10 changes: 8 additions & 2 deletions autoload/ctrlp.vim
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions autoload/ctrlp/quickfix.vim
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions autoload/ctrlp/tag.vim
Expand Up @@ -93,6 +93,7 @@ fu! ctrlp#tag#accept(mode, str)
el
exe cmd tg
en
cal ctrlp#setlcdir()
endf

fu! ctrlp#tag#id()
Expand Down
28 changes: 14 additions & 14 deletions doc/ctrlp.txt
Expand Up @@ -87,6 +87,17 @@ When opening a file with <cr> or <c-t>, if the file’s already opened somewhere
2 - jump tab as well if the buffer’s 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: >
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
18 changes: 7 additions & 11 deletions readme.md
Expand Up @@ -47,18 +47,14 @@ according to this variable:
0 - don’t 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
Vim’s option `wildignore` and/or the option `g:ctrlp_custom_ignore`. Examples:
* If you want to exclude directories or files from the search, use the Vim’s
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 = {
Expand All @@ -71,8 +67,8 @@ Vim’s 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._
Expand Down

0 comments on commit 8dde6d0

Please sign in to comment.