Open ChristianTackeGSI opened 1 year ago
Currently, the plugin doesn't provide a way of changing the default mode for the CtrlPLastMode
. Also, there is no API to update the ControlP mode triggered last time.
But to achieve the goal, you can implement your version of CtrlPLastMode
like this:
function! s:my_last_mode(argv) abort
let s:lm = get(s:, 'lm', 'buf')
cal ctrlp#init(s:lm, { 'args': a:argv })
let s:lm = -1
endfunction
com! -n=? MyLastMode cal <SID>my_last_mode(<q-args>)
Hope this helps.
This seems to work nicely for me! Thanks!
Could this be added to some docs? Maybe as an example on how to customize things? (Or is it already and I missed it?)
I like CtrlPLastMode! But in a new editing session, it starts out with the default Files mode, which I (currently) use rarely. I use Buffer first and then MRU. So I would like to set the initial mode of LastMode to Buffer. Is this possuble?
I even tried things like
call ctrlp#switchtype(0)
,call ctrlp#setlines(0)
, orcall ctrlp#call("s:setlines_pre", -1)
. But they either fail with an error or set the mode of the next LastMode invocation somewhat wrong.