Star command behavior (*)

I sometimes noticed that using * to search for a word under the cursor will sometimes have slightly different behavior (usually when I switch between different computers). The problem is that I am searching for a word that has a word in front of it (for example, a C ++ pointer). For instance:

 MyPointer *foo; ... foo = new MyPointer(); 

When I move the cursor over the first occurrence of "foo", it usually searches for that exact word (for example, /\<foo\> ), but sometimes it will include the * character in its search (for example, /\<*foo\> ) , because of which it cannot find any other occurrences of this variable, since it contains the * character.

Does anyone know what causes this behavior and / or how to control it?

+6
source share
1 answer

The behavior is affected by the isk ( iskeyword ) parameter.
This may change when switching to another buffer.
You can type :help 'isk' to find out more.

+6
source

Source: https://habr.com/ru/post/910808/


All Articles