Update docs
This commit is contained in:
parent
fcd20d1c94
commit
8dde6d0f7c
@ -1164,6 +1164,12 @@ fu! ctrlp#setdir(path, ...)
|
|||||||
let cmd = a:0 ? a:1 : 'lc!'
|
let cmd = a:0 ? a:1 : 'lc!'
|
||||||
sil! exe cmd ctrlp#fnesc(a:path)
|
sil! exe cmd ctrlp#fnesc(a:path)
|
||||||
endf
|
endf
|
||||||
|
|
||||||
|
fu! ctrlp#setlcdir()
|
||||||
|
if exists('*haslocaldir')
|
||||||
|
cal ctrlp#setdir(getcwd(), haslocaldir() ? 'lc!' : 'cd!')
|
||||||
|
en
|
||||||
|
endf
|
||||||
" Highlighting {{{2
|
" Highlighting {{{2
|
||||||
fu! s:syntax()
|
fu! s:syntax()
|
||||||
for [ke, va] in items(s:hlgrps) | if !hlexists('CtrlP'.ke)
|
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
|
if !empty(a:tail) || j2l
|
||||||
sil! norm! zvzz
|
sil! norm! zvzz
|
||||||
en
|
en
|
||||||
if exists('*haslocaldir') && cmd != 'bad'
|
if cmd != 'bad'
|
||||||
cal ctrlp#setdir(getcwd(), haslocaldir() ? 'lc!' : 'cd!')
|
cal ctrlp#setlcdir()
|
||||||
en
|
en
|
||||||
endf
|
endf
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@ fu! ctrlp#quickfix#accept(mode, str)
|
|||||||
exe cmd ctrlp#fnesc(filpath)
|
exe cmd ctrlp#fnesc(filpath)
|
||||||
cal cursor(items[2], items[3])
|
cal cursor(items[2], items[3])
|
||||||
sil! norm! zvzz
|
sil! norm! zvzz
|
||||||
|
cal ctrlp#setlcdir()
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fu! ctrlp#quickfix#id()
|
fu! ctrlp#quickfix#id()
|
||||||
|
@ -93,6 +93,7 @@ fu! ctrlp#tag#accept(mode, str)
|
|||||||
el
|
el
|
||||||
exe cmd tg
|
exe cmd tg
|
||||||
en
|
en
|
||||||
|
cal ctrlp#setlcdir()
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fu! ctrlp#tag#id()
|
fu! ctrlp#tag#id()
|
||||||
|
@ -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.
|
2 - jump tab as well if the buffer’s opened in another tab.
|
||||||
0 - disable this feature.
|
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'*
|
*'g:ctrlp_working_path_mode'*
|
||||||
When starting up, |CtrlP| sets its local working directory according to this
|
When starting up, |CtrlP| sets its local working directory according to this
|
||||||
variable: >
|
variable: >
|
||||||
@ -224,9 +235,9 @@ Examples: >
|
|||||||
Note #1: the `*/` in front of each directory glob is required.
|
Note #1: the `*/` in front of each directory glob is required.
|
||||||
|
|
||||||
Note #2: |wildignore| influences the result of |expand()|, |globpath()| and
|
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
|
|glob()| which many plugins use to find stuff on the system (e.g. VCS related
|
||||||
looks for .git/, some other plugins look for external .exe tools on Windows).
|
plugins look for .git/, .hg/,... some other plugins look for external *.exe
|
||||||
So be a little mindful of what you put in your |wildignore|.
|
tools on Windows). So be a little mindful of what you put in your |wildignore|.
|
||||||
|
|
||||||
*'g:ctrlp_custom_ignore'*
|
*'g:ctrlp_custom_ignore'*
|
||||||
In addition to |'wildignore'|, use this for files and directories you want only
|
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
|
Any other key - use the behavior specified with |g:ctrlp_open_new_file| and
|
||||||
|g:ctrlp_open_multiple_files|.
|
|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'*
|
*'g:ctrlp_follow_symlinks'*
|
||||||
Set this to 1 to follow symbolic links when listing files: >
|
Set this to 1 to follow symbolic links when listing files: >
|
||||||
let g:ctrlp_follow_symlinks = 0
|
let g:ctrlp_follow_symlinks = 0
|
||||||
|
18
readme.md
18
readme.md
@ -47,18 +47,14 @@ according to this variable:
|
|||||||
0 - don’t manage working directory.
|
0 - don’t manage working directory.
|
||||||
1 - the parent directory of the current file.
|
1 - the parent directory of the current file.
|
||||||
2 - the nearest ancestor that contains one of these directories or files:
|
2 - the nearest ancestor that contains one of these directories or files:
|
||||||
|
`.git/` `.hg/` `.svn/` `.bzr/` `_darcs/`
|
||||||
|
|
||||||
.git/
|
* If you want to exclude directories or files from the search, use the Vim’s
|
||||||
.hg/
|
option `wildignore` and/or the option `g:ctrlp_custom_ignore`. Examples:
|
||||||
.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:
|
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
set wildignore+=*/.git/*,*/.hg/*,*/.svn/* " for Linux/MacOSX
|
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
|
||||||
set wildignore+=.git\*,.hg\*,.svn\* " for Windows
|
set wildignore+=tmp\*,*.swp,*.zip,*.exe " Windows
|
||||||
|
|
||||||
let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$'
|
let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$'
|
||||||
let g:ctrlp_custom_ignore = {
|
let g:ctrlp_custom_ignore = {
|
||||||
@ -71,8 +67,8 @@ Vim’s option `wildignore` and/or the option `g:ctrlp_custom_ignore`. Examples:
|
|||||||
* Use a custom file listing command with:
|
* Use a custom file listing command with:
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux
|
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 = 'dir %s /-n /b /s /a-d' " Windows
|
||||||
```
|
```
|
||||||
|
|
||||||
_Check [the docs][2] for more mappings, commands and options._
|
_Check [the docs][2] for more mappings, commands and options._
|
||||||
|
Loading…
x
Reference in New Issue
Block a user