Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim: How to change/select function name

Tags:

vim

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

like image 921
v2k Avatar asked May 26 '26 01:05

v2k


1 Answers

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

For this add . as a word separator:

:set iskeyword+=\.
like image 79
Benjamin Bannier Avatar answered May 30 '26 03:05

Benjamin Bannier