Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 9 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .