v2k
v2k

Reputation: 1093

Vim: How to change/select function name

Given:

function(param);

With the cursor anywhere on function, I can use ciw on function to replace it, or viw to select the function name.

How do I do the same thing in the following cases:

object.function(param);
object.function<blah>(param);

Note that ciW or viW does not work. Does this require redefining how vim respects its 'words'?

Upvotes: 3

Views: 363

Answers (1)

Benjamin Bannier
Benjamin Bannier

Reputation: 58584

You are on the right track, you need to adjust the way vim separates words.

For this add . as a word separator:

:set iskeyword+=\.

Upvotes: 6

Related Questions