parent
92b0774d35
commit
4f7d0a30f4
@ -14,6 +14,7 @@ fu! ctrlp#mrufiles#opts()
|
|||||||
\ 'exclude': ['s:ex', ''],
|
\ 'exclude': ['s:ex', ''],
|
||||||
\ 'case_sensitive': ['s:cseno', 1],
|
\ 'case_sensitive': ['s:cseno', 1],
|
||||||
\ 'relative': ['s:re', 0],
|
\ 'relative': ['s:re', 0],
|
||||||
|
\ 'save_on_update': ['s:soup', 1],
|
||||||
\ }]
|
\ }]
|
||||||
for [ke, va] in items(opts)
|
for [ke, va] in items(opts)
|
||||||
let [{va[0]}, {pref.ke}] = [pref.ke, exists(pref.ke) ? {pref.ke} : va[1]]
|
let [{va[0]}, {pref.ke}] = [pref.ke, exists(pref.ke) ? {pref.ke} : va[1]]
|
||||||
@ -62,8 +63,14 @@ fu! s:addtomrufs(fname)
|
|||||||
if ( !empty({s:in}) && fn !~# {s:in} ) || ( !empty({s:ex}) && fn =~# {s:ex} )
|
if ( !empty({s:in}) && fn !~# {s:in} ) || ( !empty({s:ex}) && fn =~# {s:ex} )
|
||||||
\ || !empty(getbufvar('^'.fn.'$', '&bt')) || !filereadable(fn) | retu
|
\ || !empty(getbufvar('^'.fn.'$', '&bt')) || !filereadable(fn) | retu
|
||||||
en
|
en
|
||||||
cal filter(s:mrufs, 'v:val !='.( {s:cseno} ? '#' : '?' ).' fn')
|
if ( {s:cseno} && get(s:mrufs, 0, '') !=# fn )
|
||||||
cal insert(s:mrufs, fn)
|
\ || ( !{s:cseno} && get(s:mrufs, 0, '') !=? fn )
|
||||||
|
cal filter(s:mrufs, 'v:val !='.( {s:cseno} ? '#' : '?' ).' fn')
|
||||||
|
cal insert(s:mrufs, fn)
|
||||||
|
if {s:soup}
|
||||||
|
cal s:savetofile(s:mergelists())
|
||||||
|
en
|
||||||
|
en
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fu! s:savetofile(mrufs)
|
fu! s:savetofile(mrufs)
|
||||||
@ -118,7 +125,7 @@ fu! ctrlp#mrufiles#init()
|
|||||||
let s:locked = 0
|
let s:locked = 0
|
||||||
aug CtrlPMRUF
|
aug CtrlPMRUF
|
||||||
au!
|
au!
|
||||||
au BufAdd,BufEnter,BufLeave,BufUnload * cal s:record(expand('<abuf>', 1))
|
au BufAdd,BufEnter,BufLeave,BufWritePost * cal s:record(expand('<abuf>', 1))
|
||||||
au QuickFixCmdPre *vimgrep* let s:locked = 1
|
au QuickFixCmdPre *vimgrep* let s:locked = 1
|
||||||
au QuickFixCmdPost *vimgrep* let s:locked = 0
|
au QuickFixCmdPost *vimgrep* let s:locked = 0
|
||||||
au VimLeavePre * cal s:savetofile(s:mergelists())
|
au VimLeavePre * cal s:savetofile(s:mergelists())
|
||||||
|
@ -75,6 +75,7 @@ Overview:~
|
|||||||
|ctrlp_mruf_relative|.........Show only MRU files in the working directory.
|
|ctrlp_mruf_relative|.........Show only MRU files in the working directory.
|
||||||
|ctrlp_mruf_default_order|....Disable sorting.
|
|ctrlp_mruf_default_order|....Disable sorting.
|
||||||
|ctrlp_mruf_case_sensitive|...MRU files are case sensitive or not.
|
|ctrlp_mruf_case_sensitive|...MRU files are case sensitive or not.
|
||||||
|
|ctrlp_mruf_save_on_update|...Save the list to disk whenever it's updated.
|
||||||
|
|
||||||
Advanced options:
|
Advanced options:
|
||||||
|ctrlp_open_func|.............Use custom file opening functions.
|
|ctrlp_open_func|.............Use custom file opening functions.
|
||||||
@ -574,6 +575,12 @@ MRU entries: >
|
|||||||
let g:ctrlp_mruf_case_sensitive = 1
|
let g:ctrlp_mruf_case_sensitive = 1
|
||||||
<
|
<
|
||||||
|
|
||||||
|
*'g:ctrlp_mruf_save_on_update'*
|
||||||
|
Set this to 0 to disable saving of the MRU list to disk whenever the list is
|
||||||
|
updated, saving will then only occur when exiting Vim: >
|
||||||
|
let g:ctrlp_mruf_save_on_update = 1
|
||||||
|
<
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
Advanced options:~
|
Advanced options:~
|
||||||
|
|
||||||
@ -1249,7 +1256,8 @@ CHANGELOG *ctrlp-changelog*
|
|||||||
+ New options: |g:ctrlp_abbrev|,
|
+ New options: |g:ctrlp_abbrev|,
|
||||||
|g:ctrlp_key_loop|,
|
|g:ctrlp_key_loop|,
|
||||||
|g:ctrlp_open_func|,
|
|g:ctrlp_open_func|,
|
||||||
|g:ctrlp_tabpage_position|
|
|g:ctrlp_tabpage_position|,
|
||||||
|
|g:ctrlp_mruf_save_on_update|
|
||||||
+ Rename:
|
+ Rename:
|
||||||
*g:ctrlp_dotfiles* -> |g:ctrlp_show_hidden|.
|
*g:ctrlp_dotfiles* -> |g:ctrlp_show_hidden|.
|
||||||
+ Change |g:ctrlp_switch_buffer|'s and |g:ctrlp_working_path_mode|'s type
|
+ Change |g:ctrlp_switch_buffer|'s and |g:ctrlp_working_path_mode|'s type
|
||||||
|
Loading…
x
Reference in New Issue
Block a user