I'm using ctrlpvim/ctrlp.vim to open files by fuzzy search.Is there a way to get the full path of the searched file and insert it under cursor, instead of opening it?
Is there a way to insert a path of the file instead of opening it with CtrlP plugin?
plugin ctrlp
You can customize the function handling the opening of files, as explained at :help 'g:ctrlp_open_func'.You could try something similar to this:function! CtrlPOpenFunc(action, line)   if a:action =~ '^h$'           Get the filename      let filename = fnameescape(fnamemodify(a:line, ':p'))       Close CtrlP      call ctrlp#exit()      call ctrlp#mrufiles#add(filename)       insert the contents of filename into the buffer      put =filename   else           Use CtrlP's default file opening function      call call('ctrlp#acceptfile', [a:action, a:line])   endifendfunctionlet g:ctrlp_open_func = {          \ 'files': 'CtrlPOpenFunc',         \ 'mru files': 'CtrlPOpenFunc'          \ }, in order to insert the file path by pressing Ctrl-x in the Ctrlp window.