E37: No write since last change (add ! to override)

2006-09-05

="" 挿入 17:27

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('""')
		endif
	endif
endfunction

function! s:CursorInsert(str)
	let line = getline('.')
	let col  = col('.')
	let pos  = getpos('.')

	if col == strlen(line)
		exe 'normal! a' . a:str
	else
		exe 'normal! i' . a:str
		normal l
	endif
endfunction

結局こんなんにした。挿入したあとに normal h するのはうまくいかない。

test

DenDrickyDenDricky2018/04/26 08:37Levitra Generico Contrareembolso <a href=http://cheapciali.com>buy cialis</a> Cipro And Keflex Cialis In Offerta

MatrareMatrare2018/10/13 01:52Buy Propecia In Ontario Amoxicillin And Diphenhydramine Hci Interactions <a href=http://cialicheap.com>cialis</a> Amoxicillin Buy Buy Cialis Soft Tabs Online