in some case I have name of variables with a _ like hello_world.

in vim, in normal mode, with dw, I can delete from cursor position to end of word.

How I can delete from current cursor position to - ?

In the hello_world case, I can make this with df_, but, exist a general way ? (and without delete the _)


To delete from the cursor up to but not including the _, type


I don't know what you mean by a "general way". You can find more here:

:help d
:help motion.txt
| improve this answer | |

My camelcasemotion plugin provides movements and text objects especially for CamelCaseWords and underscore_notation. With it, you can delete hello in your example via d,e.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.