6

The dictionary feature in vim allows you to use a file (for instance /usr/share/dict/words) and set multiple paths within the dict option to search on.

Now the file I'm searching on has several words with - in them, and I still wish to match after the - after activating autocomplete, so is there a way to make the - a matched character within the dict feature?

  • 2
    I think that set iskeyword+=- should do what you want. See :h 'iskeyword'. I'm not posting this as an answer because I can't test it right now so let me know if that work? – statox Jan 30 '17 at 8:02
  • 1
    @statox I tried it and that did the trick! Thank you! – leeand00 Jan 31 '17 at 21:09
6

The option iskeyword defines which characters should be considered as part of a word. This option uses the += and -= syntax to add or remove some characters. Thus the following line will add the character - in the option and will allow you to complete words containing a -:

set iskeyword+=-

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.