I would like to repeat M-x string-inflection-camelcase on several words. For example in:

foo_bar baz qux-quux quuz CORGE_GRAULT GARPLY

I place my cursor on foo_bar and then enter M-x string-inflection-camelcase, which changes foo_bar to FooBar. I can then move forward via M-f and C-f several times and press C-x ESC ESC, which brings up Redo: (string-inflection-camelcase). I can then press Enter to change CORGE_GRAULT to CorgeGrault.

However, this key sequence is slow compared to the C-x z z commands used for a basic repeat.

How can I re-execute string-inflection-camelcase more efficiently after moving my cursor around?


Define a keyboard macro that includes the change command and the move to the beginning of the next word. Then repeat the macro as many times as you need.

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.