Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 _)

share|improve this question
up vote 3 down vote accepted

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
share|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.

share|improve this answer
I've made a lot of use of that plugin. Thanks, Ingo! – echristopherson Jun 21 '13 at 20:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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