<p>vi treats dash <code>-</code> and space <code>&nbsp;</code> as word separators for commands such as <code>dw</code> and <code>cw</code>.</p>

<p>Is there a way to add underscore <code>_</code> as well?</p>

<p>I quite often want to change part of a variable name containing underscores, such as changing <code>src_branch</code> to <code>dest_branch</code>. I end up counting characters and using <code>s</code> (like <code>3sdest</code>), but it would be much easier to use <code>cw</code> (like <code>cwdest</code>).</p>

You could type
```
cf_dest_
```
and save the counting part.
Edit:
or as suggested:
```
ct_
```
changes text until right before the underline character. (I'm using the
```
f
```
motion more, so it came more naturally to me)
Or you could redefine
```
'iskeyword'
```
(
```
:help iskeyword
```
for details).