Friday, May 20, 2016

Re: dictionary completion for words including `@' sign

Nikolay Pavlov wrote:

> 2016-05-19 21:40 GMT+03:00 Eric Smith <es@fruitcom.com>:
> > I don't only want to enjoy autocomplete of my contacts when in gmail, but also
> > for my mutt.
> >
> > I have a file with all my email addresses and
> > set dict=emails.txt.
> >
> > When I complete with dictionary completion (mapped to <tab>), then I only receive
> > the first part of the email addresses, like,
> >
> > foo<tab>
> > foo.bar
> >
> > How do I return
> > foo<tab>
> > foo.bar@baz.com
> >
> > And if I go.
> > <tab>
> > it expands to
> > foo.bar
> > baz
> >
> > Here are one of the many settings of isfname, that I tried, all
> > without a breakthrough;
> > set isfname=@,48-57,/,\\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,=
> >
> > what gives?
> >
> > Eric
>
> Why &isfname? Given that &dict option documentation speaks about
> "words" and "keyword characters" I guess you need &iskeyword.
>
> Note that altering this may break some syntax files. Also many syntax
> and filetype files have no idea that &iskeyword is a *user* setting
> and they should even use `:syntax iskeyword` and not `setlocal
> iskeyword=…` (added only recently!).

You can indeed set 'iskeyword', e.g.:
:set iskeyword+=.,@-@

However, this has many side effects. I had a vague plan to split
'iskeyword' into a group of options, where it applies in different
situations. But that didn't get realized yet.

A workaround is to remap certain keys, e.g. Tab, to set the option,
perform the operation, and restore the option.

--
Hacker: Someone skilled in computer programming (good guy).
Cracker: A hacker that uses his skills to crack software (bad guy).

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: