Search code examples
vimctrlp

In CtrlP, how to set the `mru` mode as the default mode?


The CtrlP's default file mode is too slow when I open CtrlP in the root of my $HOME dir. it is due to that there are too much files and dirs in my home dir.

I have speeded up the scanning according to this answer by using ag command instead. However, the scan speed is still slow.

So, I want to set the MRU mode as the default mode of CtrlP. How to do that?


Solution

  • I agree with @romainl's answer, however for the sake of answering the question :

    From :help CtrlP

                                                                *'g:ctrlp_map'*
     Use this option to change the mapping to invoke CtrlP in |Normal| mode: >
     let g:ctrlp_map = '<c-p>'
                                                               *'g:ctrlp_cmd'*
    Set the default opening command to use when pressing the above mapping: >
     let g:ctrlp_cmd = 'CtrlP'
    

    Put in your vimrc :

    let g:ctrlp_map='<c-p>'
    let g:ctrlp_cmd = 'CtrlPMRU'