Text case coercion

3.6
(235)

The Abolish plugin provides handy options to coerce strings between a variety of casing, naming, or textual conventions, each with 3 simple keystrokes. For example, an underscored string like employee_name can become EmployeeName by simply typing crm.

In the chart below, the three keystrokes indicated between the square brackets can coerce a string like SomeLongIdentifier to the result provided:

  • [crs] some_long_identifier
  • [crm] SomeLongIdentifier
  • [crc] someLongIdentifier
  • [cru] SOME_LONG_IDENTIFIER
  • [cr-] some-long-identifier
  • [cr.] some.long.identifier
  • [cr] some long identifier
  • [crt] Some Long Identifier

All the commands start with cr and many of them can be remembered with simple mnemonics, like crc for camelCase or cr- for dasherize case.

Here’s a short demo showing conversion between various formats using several of the commands above:

Note that some coercions are one-way, in that subsequent coercions may have no way of recognizing what may have been a single word before being dasherized or having spaces inserted.

How useful was this tip?

Average rating 3.6 / 5. Vote count: 235

No votes so far! Be the first to rate this tip.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Written by

Andy Libby

30 Posts

Rider of bicycles. Writer of code. User of Vim.
View all posts

Leave a reply

Your email address will not be published. Required fields are marked *