Vim6スクリプトお勉強スレat UNIX
Vim6スクリプトお勉強スレ - 暇つぶし2ch803:名無しさん@お腹いっぱい。
06/08/11 16:40:31
こんなかんじだろうか
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


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch