Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

up vote 3 down vote accepted

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

dt_

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

 
discard

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.