venuparipelly
unread,Apr 2, 2011, 11:36:07 PM4/2/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vim_use
Hi all,
I would like to custom auto-complete function for my files. I can do
something like this as provided in vimdoc.
fun! CompleteMonths(findstart, base)
if a:findstart
" locate the start of the word
let line = getline('.')
let start = col('.') - 1
while start > 0 && line[start - 1] =~ '\a'
let start -= 1
endwhile
return start
else
" find months matching with "a:base"
let res = []
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")
if m =~ '^' . a:base
call add(res, m)
endif
endfor
return res
endif
endfun
set completefunc=CompleteMonths
But while showing in popup menu, i want different value to show. In
above example, When I type Ja, It shoulde show January(2011) in popup,
but when i select it should insert only Jan. Is there anyway to do
this.
Basically I want to show some more info to user, apart from auto-
complete string. Please help with this... this is very usefull for my
project.