Wednesday, August 8, 2012

Re: capitalize the current word in insert mode

On 8Aug2012, at 00:39, vim_use@googlegroups.com wrote:

>
> sinbad <sinbad.sinbad@gmail.com> Aug 07 11:05PM -0700
>
> how can one capitalize the current word or the
> word just before the current cursor position
> with out leaving the insert mode ? leaving insert
> mode and capitalize and come back to insert mode
> is becoming a tedious task for me ...:)
>
> tia
>

In your .vimrc file, add something like

imap ~~ <esc>guiw~la

Then, in insert mode, when you type ~~ (or whatever sequence
appeals to you), vim will shift temporarily into normal command
mode (via the <esc>), then capitalize the current word, then
switch back to insert mode (with the 'a').



--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: