Teach Vim about titlecase, with support for motions and text objects
Vim script
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
plugin Fixed #7 - Include 'e' option in substitute Feb 22, 2018
License.md Add MIT License file Jan 28, 2017
README.md Fix spelling. (#6) Jan 28, 2017


Vim Titlecase

Titlecase is a vim plugin that adds a new operator (command that takes a text object or motion to act on) for titlecasing text.

   this is some text  |  this is Some text
 method('some args')  |  method('Some Args')
        a title line  |   A Title Line


The main interface to the plugin is via the <Plug>Titlecase operator, by default mapped to gt.

The gt mapping will wait for a text object or motion before completing the titlecase operation. This means gti' will titlecase inside of single quotes, gtap will titlecase a paragraph, etc. gt will also work on a visual selection.

In addition, gT will titlecase the current line.


Be default titlecase maps itself to gt, but this interferes with the default mapping for switching tabs. If you would like to disable the default maps, add the following to your vimrc:

Bundle 'christoomey/vim-titlecase'

let g:titlecase_map_keys = 0

You can then add any mappings you would like with the following:

nmap <leader>gt <Plug>Titlecase
vmap <leader>gt <Plug>Titlecase
nmap <leader>gT <Plug>TitlecaseLine
<Plug>Titlecase " Titlecase the region defined by a text object or motion
<Plug>TitlecaseLine " Titlecase the entire line