I’ve noticed on occasion that that using * to search for the word under the cursor occasionally will have slightly different behavior (usually when I’m switching between various computers). The issue is when I perform a search for a word that has a * in front of it (like a c++ pointer). For example:
MyPointer *foo;
...
foo = new MyPointer();
When I move the cursor over the first occurrence of “foo”, it usually does a search for that exact word (e.g. /\<foo\>), but sometimes it will include the * character in its search (e.g. /\<*foo\>) which causes it to fail to find any other occurrences of that variable since it’s including the * character.
Does anyone know what causes this behavior and/or how to control it?
The behavior is affected by the
isk(iskeyword) option.It may different when you switch to a different buffer.
You can type
:help 'isk'to read more.