I recently discovered iskeyword as in set iskeyword-=_ so that I can change just part of a snake case word, like changing character_idx to char_idx using ciw. This was working great, except sometimes I want to change the entire word, so I turned it off (it also was causing havoc with the syntax highlighting).

I am wondering if there is a way to define a new text object that is essentially w with iskeyword-=_ set so that I could execute ci\ (or something, I am not sure how to prevent collisions with vim commands already in existence) and change just part of a snake case word, while retaining ciw for whole snake case words.

I'm not even sure how to tag this.

Your Answer

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

Browse other questions tagged or ask your own question.