2

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?

Community
  • 1
  • 1
Douglas Su
  • 3,214
  • 7
  • 29
  • 58

2 Answers2

5

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'
Kjartan
  • 18,591
  • 15
  • 71
  • 96
Xavier T.
  • 40,509
  • 10
  • 68
  • 97
0
  1. Don't start Vim, and don't use a fuzzy finder, in your $HOME. It's a pretty stupid idea to begin with and no amount of ag-based customization will make it better.

    There's only one useful way to start Vim: navigate to your project and run Vim there.

  2. Use the :CtrlPMRU command instead of :CtrlP.

romainl
  • 186,200
  • 21
  • 280
  • 313