2

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.

2
  • If you're double clicking in vim you're doing it wrong :)
    – EBGreen
    Feb 7, 2012 at 15:14
  • ^^ why? It's not vi anymore.
    – anishsane
    Dec 28, 2016 at 5:21

1 Answer 1

4

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.

1
  • Thanks! That seems to work for me. I guess I'll find the side-effects in due course.
    – Crosbie
    Feb 7, 2012 at 15:25

You must log in to answer this question.

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