guanqun/vim-mutt-aliases-plugin — Issue #1: A Different Approach
Author: baskerville
Created: 2011-10-17 20:47:04+00:00
State: open

```

function! CompleteMuttAliases(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
" call mutt with the appropriate parameters
let result = []
if strlen(a:base)
let query_response = system("mutt -A " . a:base)
let result = split(query_response, '\n')
endif
return result
endif
endfunction
```