Custom command completion

18 views
Skip to first unread message

Rudra Banerjee

unread,
Jul 27, 2015, 7:11:59 AM7/27/15
to vim_use
Hi,

I am trying to write a plugin, where the `b:Sdir` will take the directories with source code. I am trying to achieve autocompletion as:

"MakeMake: Generate Makefile.gen
function! MakeMake()
let b:Rdir = input("Project root folder: ", ".", 'file')
exe ":lchdir ".b:Rdir

" More than 1 files can be choosed
let b:Sdir = input("Choose source dir: ", ".", "customlist,CFile")
endfunction

function! CFile(A,L,P)
return split(globpath(b:Rdir, a:A),"\n")
endfunction

But this is not working.
As normal, if I use "split(globpath(b:Rdir, "*"),"\n")" in CFile, it will show ALL files in the directory available, but not filter the files.

How can I achieve completion for this?

Reply all
Reply to author
Forward
0 new messages