Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When my cursor is on a word in normal mode, and I press '*', vim searches for the word in the document. But, if the word ends with a colon, vim includes the colon in its matching. How do I prevent this from happening?

share|improve this question
    
What version of vim are you using? I can't repeat the problem on 7.3. –  Ash Feb 15 '13 at 23:53
    
@Ash: It must be a setting that one of my add-ons is changing. I just can't find the setting! I'm using 7.3 of MacVim. –  Neil G Feb 16 '13 at 0:31

1 Answer 1

up vote 6 down vote accepted

The characters that are included in such a search are specified by the 'iskeyword' option. The default value does not include : so the : must have been added by some configuration file, probably a filetype plugin. To find out what last set the value, execute

:verbose set iskeyword?

If it was set by a filetype plugin, the author presumably thought doing so would help. If you don't like it that way, you can remove the : by creating a file, ~/.vim/after/ftplugin/<filetype>.vim for Unix or ~\vimfiles\after\ftplugin\<filetype>.vim for Windows, where <filetype>.vim is the file named in the :verbose output, and put in it this line:

setlocal iskeyword-=:

See also:

:help *
:help 'iskeyword'
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.