DEV Community

Colin Bartlett
Colin Bartlett

Posted on • Edited on • Originally published at vimtricks.substack.com

VimTrick: Text case coercion

Tim Pope's Abolish vim 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 EmployeeNameby 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

We have a short screencast demo and more details on how to use the really useful feature of Abolish over on VimTricks.

Top comments (0)