ctrlpvim / ctrlp.vim

Active fork of kien/ctrlp.vim—Fuzzy file, buffer, mru, tag, etc finder.
ctrlpvim.github.com/ctrlp.vim
Other
5.57k stars 259 forks source link

Reload options on every CtrlP invocation #194

Open renkam opened 8 years ago

renkam commented 8 years ago

I am trying to use separate mappings for using CtrlP with regexp and without them with no luck. So far I have a mapping to launch regexp mode: nmap r call ctrlp#init(0, { 'opts' : { 'regexp':1 }}) but after doing this the default mapping starts using regexp mode always - which I don't want.

I've also tried to set (in a function) let g:ctrlp_regexp = 1 before calling CtrlP, but it seems that this variable is read only once on plugin load.

How I can have a different behaviour regexp/non-regexp under different mappings or calling different functions?

tacahiroy commented 8 years ago

AFAIK, there is no options to achieve that unfortunately, I'm guessing that is useful for some people though.

ludovicchabant commented 8 years ago

Could you make a mapping that runs CtrlP and then presses <C-r> right away to switch to regexp mode instead of trying to do it with setting options?

renkam commented 8 years ago

The mapping could work, but as far I remember, currently there is no way to explicitly enable/disable regex search. Instead you could only toggle, and this is no good because you never know the starting state.