Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding new word boundry movement macros in vim

Tags:

vim

Is there a way to change the word boundaries to make it more specific to your programming language or naming convention? And then, define a new macro while keeping the basic movements like w,W,b,B etc.?

For example: Class.method_name would would not recognize the underscore as a word break.

like image 844
nate c Avatar asked Nov 23 '10 05:11

nate c


2 Answers

See How can I configure vim so that movement commands will include underscores and CamelCase, but completion will ignore them?

like image 73
Chris Morgan Avatar answered Sep 22 '22 16:09

Chris Morgan


Yes.

In your example, :set iskeyword-=_ will recognise the underscore as a word-break.

See :help 'iskeyword' for more information.

like image 20
Johnsyweb Avatar answered Sep 22 '22 16:09

Johnsyweb