When I press <c-p> for autocompletion a list based on my complete setting appears. I have a completion file as follows (at ~/emails)`:

[email protected]
[email protected]
[email protected]

But when I write (in insert mode) joh and press <c-p> only


Appear as the completions. i.e. without the email domains.

My iskeyword and complete are as follows:

set iskeyword=@,48-57,_,-,.,192-255
set complete=k~/emails

My iskeyword has @ explicitly included, why does the completion list do not treat the entire email as a cword?

(:expand('<cword>') does not take the entire email as a cword either).

  • 2
    A while ago I wrote a complete_email.vim plugin which allows completing emails from a file with <C-x><C-m> (or another mapping of your choice). It also adds the name (e.g. "Example user" <[email protected]>) and shows the phone number (if entered). Commented Jul 14, 2016 at 23:14
  • @Carpetsmoker - Heh, to be really fair my "file" is the output of abook --mut-query (of which you are aware given that link :) ). I just simplified it for MCVE reasons. But yeah, that pointed me to an abook solution, thanks.
    – grochmal
    Commented Jul 14, 2016 at 23:22
  • 1
    I have my own completion setup for using vim together with mutt. You can find it here Commented Jul 15, 2016 at 7:43

1 Answer 1


The format for 'iskeyword' is explained at :help 'isfname'. In particular:

To include '@' itself use "@-@".

@ is shorthand meaning 'all characters where isalpha() returns TRUE'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.