sponsor Vim development Vim logo Vim Book Ad

titlecase.vim : Convert range or visual to titlecase.

 script karma  Rating 3/4, Downloaded by 1593  Comments, bugs, improvements  Vim wiki

created by
Robert KellyIV
 
script type
utility
 
description
Sample:
Given:
Change a range or visual to title case, i.e.
":TitleCase<CR>" results in:
Change A Range Or Visual To Title Case, I.E.

This simple changes (via :s) \<\l (start of word, lowercase a-z) to uppercase. Probably not perfect Titlecase but works good enough for a quickie!

Remaps (with no elegance) <F5> to FeralTitleCase_Visual, change as desired.

Visual method works for single line visuals only, multi line it tries to be clever and makes a mess.. use with caution, single (part of) line works fine though. (needs to have a check that say I don't do multi line visuals!; or only char wise visuals or something).
Range Command (defaults to current line) is:TitleCase
Its small, crude and dirty. But it works :)

Happy VIMing!
 
install details
Place in plugin folder

Uninstall remove or rename script file.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
titlecase.vim 0.1 2002-10-07 6.0 Robert KellyIV Initial upload
ip used for rating: 54.226.242.26

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github