Permalink
Browse files

Add ToggleMRURelative

Closes #398
  • Loading branch information...
1 parent 0102255 commit f0458d7026fd3cfe4f6e8fb787034a342314d418 @kien committed Jun 10, 2013
Showing with 12 additions and 0 deletions.
  1. +5 −0 autoload/ctrlp.vim
  2. +4 −0 autoload/ctrlp/mrufiles.vim
  3. +3 −0 doc/ctrlp.txt
View
@@ -937,6 +937,11 @@ fu! s:ToggleKeyLoop()
en
endf
+fu! s:ToggleMRURelative()
+ cal ctrlp#mrufiles#tgrel()
+ cal s:PrtClearCache()
+endf
+
fu! s:PrtSwitcher()
let [s:force, s:matches] = [1, 1]
cal s:BuildPrompt(1)
@@ -126,6 +126,10 @@ fu! ctrlp#mrufiles#bufs()
retu s:mrbs
endf
+fu! ctrlp#mrufiles#tgrel()
+ let {s:re} = !{s:re}
+endf
+
fu! ctrlp#mrufiles#cachefile()
if !exists('s:cadir') || !exists('s:cafile')
let s:cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().'mru'
View
@@ -572,6 +572,9 @@ Example: >
Set this to 1 to show only MRU files in the current working directory: >
let g:ctrlp_mruf_relative = 0
<
+Note: you can use a custom mapping to toggle this option inside the prompt: >
+ let g:ctrlp_prompt_mappings = { 'ToggleMRURelative()': ['<F2>'] }
+<
*'g:ctrlp_mruf_default_order'*
Set this to 1 to disable sorting when searching in MRU mode: >

0 comments on commit f0458d7

Please sign in to comment.