There is however a general solution: it turns out there is yet another thing I didn't know. You can change what a 'word' is in vim by modifying the 'iskeyword' setting.
To see what characters are considered to be part of a word you can type:
:set isk
iskeyword=@,48-57,_,192-255
I've found that its pretty easy to change things up when you need a slightly different usage from */#. For instance, if you are searching some keywords of the form:
final int TRANSIENT-RAT-SCH-CODE = -1;
Suppose your cursor is on the 'T'. If you hit * or # you would be brought to the next or previous instance of 'TRANSIENT' because '-' isn't in the 'iskeyword' setting. Quick fix? Do:
:set isk+=-
Then it'll match the whole big bad thing.
No comments:
Post a Comment