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 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

1 Answer 1

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

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.