メールアドレスを補完する completefunc †
メッセージ †注意:vim7 以降が必要 function! CompleteMail(findstart, base) if a:findstart let str = getline(".")[: col('.') - 2] let start = match(str, '[[:alnum:]_.-]*\%(@[[:alnum:]_.-]*\)\=$') return start else redir => str silent g/[[:alnum:]_.-]\+@[[:alnum:]_.-]\+/ redir END let mx = '[[:alnum:]_.-]\+@[[:alnum:]_.-]\+' let i = match(str, mx) while !complete_check() && i != -1 let address = matchstr(str, mx, i) if stridx(address, a:base) == 0 call complete_add(address) endif let i = match(str, mx, i + len(address)) endwhile return [] endif endfunction :set completefunc=CompleteMail |