optional root markers
This commit is contained in:
parent
5ae7572934
commit
8d1ec536d3
@ -631,7 +631,7 @@ func! ctrlp#SetWorkingPath(...)
|
|||||||
se noacd
|
se noacd
|
||||||
endif
|
endif
|
||||||
sil! exe 'chdir' fnameescape(expand('%:p:h'))
|
sil! exe 'chdir' fnameescape(expand('%:p:h'))
|
||||||
if s:pathmode || l:pathmode | retu | endif
|
if s:pathmode == 1 || l:pathmode == 1 | retu | endif
|
||||||
let markers = [
|
let markers = [
|
||||||
\ 'root.dir',
|
\ 'root.dir',
|
||||||
\ '.vimprojects',
|
\ '.vimprojects',
|
||||||
@ -640,6 +640,11 @@ func! ctrlp#SetWorkingPath(...)
|
|||||||
\ '.hg/',
|
\ '.hg/',
|
||||||
\ '.bzr/',
|
\ '.bzr/',
|
||||||
\ ]
|
\ ]
|
||||||
|
if exists('g:ctrlp_root_markers')
|
||||||
|
\ && type(g:ctrlp_root_markers) == 3
|
||||||
|
\ && !empty(g:ctrlp_root_markers)
|
||||||
|
let markers = g:ctrlp_root_markers
|
||||||
|
endif
|
||||||
for marker in markers
|
for marker in markers
|
||||||
sil! cal s:FindRoot(getcwd(), marker)
|
sil! cal s:FindRoot(getcwd(), marker)
|
||||||
if getcwd() != expand('%:p:h') | break | endif
|
if getcwd() != expand('%:p:h') | break | endif
|
||||||
|
@ -92,6 +92,12 @@ to your |.vimrc|; the parameter is the same (1, 2 and 0): >
|
|||||||
au BufEnter * cal ctrlp#SetWorkingPath(2)
|
au BufEnter * cal ctrlp#SetWorkingPath(2)
|
||||||
<
|
<
|
||||||
|
|
||||||
|
*'g:ctrlp_root_markers'*
|
||||||
|
Use this to set your own root markers for the SetWorkingPath() function instead
|
||||||
|
of the default ones: >
|
||||||
|
let g:ctrlp_root_markers = ['']
|
||||||
|
<
|
||||||
|
|
||||||
*'g:ctrlp_max_height'*
|
*'g:ctrlp_max_height'*
|
||||||
Set the maximum height of the match window: >
|
Set the maximum height of the match window: >
|
||||||
let g:ctrlp_max_height = 10
|
let g:ctrlp_max_height = 10
|
||||||
|
Loading…
Reference in New Issue
Block a user