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 260 forks source link

Ctrlp commands for splits and tabs #539

Open piyushrungta25 opened 4 years ago

piyushrungta25 commented 4 years ago

Hi, I recently switched to CtrlP after using vim's inbuilt find for some time. I have below in my vimrc

nnoremap <leader>f :find *
nnoremap <leader>s :sfind *
nnoremap <leader>v :vert sfind *
nnoremap <leader>t :tabfind *

and looking to emulate something similar with CtrlP. I am looking for a way to do <leader>v, get the CtrlP prompt and when I do enter, it opens the selected file in a new vertical split. Similar with horizontal split and tab.

I am trying to avoid doing <c-v>/<c-x> after finding the match or first opening a split and then doing :CtrlP in two separate commands.

Let me know if it is possible currently. Thanks.

tacahiroy commented 4 years ago

Opening the selected file in a vertical split with <Cr> can be achieved through the variable g:ctrlp_prompt_mappings. However, if you configured like below, then <Cr> opens the file to a vertical split at any time. This mapping cannot be changed after CtrlP started.