1

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

barabara.high@someplace.com
john.doe@gmail.com
john.carpenter@ooo.ooo

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

john.doe
john.carpenter

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" <foo@example.com>) and shows the phone number (if entered). – Martin Tournoij Jul 14 '16 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 Jul 14 '16 at 23:22
  • 1
    I have my own completion setup for using vim together with mutt. You can find it here – Christian Brabandt Jul 15 '16 at 7:43
4

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, privacy policy and cookie policy

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