Hatena::Groupvim

meitetujikokuhyouの日記

 | 

2008-12-18

Capitalize

20:40

" hoge -> Hoge -> HOGE -> hoge に戻るをインサートモードで繰り返したい. 

fun! OreCapital()
"{{{
  let ic_org=&ic 
  setlocal noic
  let word=expand("<cword>")
  if len(word) == 0
    let &ic=ic_org
    return
  elseif len(word)==1
    normal ~
    let &ic=ic_org
    return
  endif
  if word[0]=~"[a-z]"
    normal! b~e
  elseif word[1]=~"[a-z]"
    normal! bgUee
  else
    normal! bguee
  endif
  let &ic=ic_org
  return
""}}}
endf

inoremap <silent> <c-^> <esc>:call OreCapital()<cr>a

" vim: fdm=marker: 

TogaToga 2012/06/30 11:54 It's a relief to find someone who can explian things so well

itmmowitmmow 2012/07/01 04:35 LUx6Fv , [url=http://xfowbszxekxj.com/]xfowbszxekxj[/url], [link=http://afoawncotxcx.com/]afoawncotxcx[/link], http://nvgeszvjlcwc.com/

zjnfvzsxqdtzjnfvzsxqdt 2012/07/02 14:20 bZ9Ekx <a href="http://oexizuziunhf.com/">oexizuziunhf</a>

cmmjcrhwffcmmjcrhwff 2012/07/03 19:36 vmaP1w , [url=http://gltbebzwqxth.com/]gltbebzwqxth[/url], [link=http://isrumfyvybgu.com/]isrumfyvybgu[/link], http://cxkntxpqnnmq.com/

ゲスト



トラックバック - http://vim.g.hatena.ne.jp/meitetujikokuhyou/20081218
 |