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 I double click in gvim it causes the current word to be selected. However, by default, a 'word' excludes special characters. I would like, for example, to be able to double click on a UNIX or Windows path and have that whole path highlighted. Can I change what gvim considers to be a word?

By way of analogy, xterm takes a -cc, 'character class range' switch. Any contiguous characters in a given class are highlighted if I double-click on one of them. I can define a character class which includes alphanumerics and the forward-slash, so when I click on a UNIX path, it highlights that whole path. I'd like something similar in gvim.

share|improve this question
If you're double clicking in vim you're doing it wrong :) – EBGreen Feb 7 '12 at 15:14
up vote 2 down vote accepted

From :help double-click:

A double click on a word selects that word. 'iskeyword' is used to specify which characters are included in a word.

So you need to change iskeyword to include slashes. set iskeyword+=/ worked for me. Keep in mind this also affects other stuff, e.g. searching. See :h iskeyword.

share|improve this answer
Thanks! That seems to work for me. I guess I'll find the side-effects in due course. – Crosbie Feb 7 '12 at 15:25

You must log in to answer this question.

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