camelCase to underscore in vi(m)

You might want to try out the Abolish plugin by Tim Pope. It provides a few shortcuts to coerce from one style to another. For example, starting with:


Typing crc [mnemonic: CoeRce to Camelcase] would give you:


Typing crs [mnemonic: CoeRce to Snake_case] would give you:


And typing crm [mnemonic: CoeRce to MixedCase] would take you back to:


If you also install repeat.vim, then you can repeat the coercion commands by pressing the dot key.

Leave a Comment