

So I decided to work off from that titlecase plugin repo and use that to a titlecase plugin myself that is consistent with gu, gU, and g~!. I find it inconsistent with the behaviors of gu, gU, and g~. If I press gt, the plugin won't capitalize it. The main one was the blockwise visual mode behavior. However, there were a few things that didn't function quite the way I wanted them to. Also it turns out that there is a titlecase plugin already: vim-titlecase. Without a proper capitalization, the sentence looks slightly off.Īt first, I wasn't planning to write a plugin. The words "The" and "Of" in "Capitalize The First Letter Of Each Word" should be capitalized.

For MVP, this command was good enough, but it is still not as good as having an actual title case.

One way to automate this is to capitalize each word in the header with g/^#/ s/\<./\u\0/g.

One main issue was to create a proper title case for the headings. I use Vim to write my articles, including this very guide. I hope to shed some light on the process and maybe inspire you to create your own unique plugin! The Problem In this chapter, I will present the breakdown of the totitle-vim plugin. It is a titlecase operator plugin, akin to Vim's uppercase gU, lowercase gu, and togglecase g~ operators. I recently wrote my first Vim plugin, totitle-vim. When you start to get good at Vim, you may want to write your own plugins.
