![]() ![]() ![]() ![]() |
![]() |
|
![]() |
||
![]() |
inoremap = <C-O>:call <SID>XMLEqualComplement()<CR> function! s:XMLEqualComplement() let line = getline('.') let col = col('.') call s:CursorInsert('=') let op = strridx(line, '<', col - 1) if op != -1 let cp = stridx(line, '>', op) if cp == -1 || cp > col call s:CursorInsert('""') " let pos = getpos('.') " let pos[2] = pos[2] - 1 " call setpos('.', pos) endif endif endfunction function! s:CursorInsert(str) let line = getline('.') let col = col('.') let pos = getpos('.') if col != strlen(line) call setline(line('.'), line[:col -2] . a:str . line[col - 1:]) let pos = getpos('.') else call setline(line('.'), line . a:str) endif let pos[2] = pos[2] + strlen(a:str) call setpos('.', pos) endfunction
クリーンアップしたつもり。が、よくわからなす。諦めて自分で横にうごかそう?
Complete って書いてた。だめだ
normal h
でいけますよ。