I now have Vim version 8.1.2102 from Sep 30 2019 15:45:59 on Fedora 30. For some reason the word boundary in C++ code now also includes the underscore somehow, so I see this:

When I have the cursor over that and press *, it will only search for quark. When I do <C-[> it will try to search for the tag quark.

There are a bunch of plugins:

$ ls .vim/bundle
molokai/             vim-eunuch/         vim-regex-collection/
SingleCompile/       vim-fish/           vim-repeat/
syntastic/           vim-fswitch/        vim-snipmate/
tlib_vim/            vim-gutentags/      vim-surround/
vim-addon-mw-utils/  vim-headings/       vim-unimpaired/
vim-dirvish/         Vim-Jinja2-Syntax/  VOoM/
vim-dokuwiki/        vim-mathematica/

I have not changed the plugins but Vim got updated and somehow this has changed. How can I further triage and fix this issue?

In the C++ code file I have this setting:


In my whole .vim directory there is not a single spot where this is set to anything nonsensical:

$ grep -R iskeyword .
./bundle/vim-fish/ftplugin/fish.vim:setlocal iskeyword=@,48-57,-,_,.,/
./bundle/vim-mathematica/syntax/mma.vim:setlocal iskeyword+=`,$
./bundle/vim-mathematica/syntax/mma.vim:setlocal iskeyword-=:,-

Fish is a shell and mma is for Wolfram Language code. Since the filetype is set to cpp, neither of them should be invoked.

I could just add set iskeyword+=_ to my .vimrc but that does not seem right.

  • 1
    What about grep -R isk .? (Vim commands/options can be abbreviated.)
    – Rich
    Oct 17, 2019 at 13:20
  • Please update the question with verbatim output of :verbose set iskeyword? since that would be a great clue into troubleshooting this! Also, what does :set ft? say?
    – filbranden
    Oct 17, 2019 at 14:07

1 Answer 1


This is configured by the 'iskeyword' setting. You can check the current value and what set that value by running the command:

:verbose set iskeyword?

See :help 'iskeyword' and :help 'isfname' for details of this setting. It is a comma delimited string which usually contains a specific _ item.

If the thing that is setting the option incorrectly cannot be configured not to do so, you can fix this by placing settings in a file in a subdirectory of your .vim/after directory: the precise best location depends on exactly what is breaking the setting in the first place, but I'm guessing adding either of the following lines to .vim/after/ftplugin/cpp.vim would work for you:

" Just add an underscore
setlocal iskeyword+=_

" Reset to default
setlocal iskeyword&
  • It says: iskeyword=a-z,A-Z and no mapping found for * and no mapping found for <C-]>. So shouldn't there also be numbers in there? Oct 17, 2019 at 10:37
  • I've updated the question. Oct 17, 2019 at 10:41
  • @MartinUeding The numbers just specify ASCII characters by their byte value, so they're not 100% necessary. But for your purposes there should definitely be an _. Does it not tell you what set the value?
    – Rich
    Oct 17, 2019 at 10:41
  • For ft it tells where it is set, but for iskeyword it does not tell me any location. Oct 17, 2019 at 10:42
  • 1
    @MartinUeding Looks like it: I just don't understand why it's not reported by :verbose (which normally works fine for system and user plugins alike). You might be able to get a head start on your grepping by viewing the output of :scriptnames in your C++ buffer, which will show you which Vimscript files have been loaded.
    – Rich
    Oct 17, 2019 at 13:18

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.