vimrc里添加
vnoremap <F3> :<C-u>call <SID>AddCharOfCursor()<CR>
"递增列模式下的字符
function! s:AddCharOfCursor()
let c = col('.')
let l = line('.')
let l0 = line("'<")
let l1 = line("'>")
let char0 = strpart(getline('.'),c-1,1)
for k in range(1, l1-l0) "从第2行开始
let str_before = strpart(getline(l+k),0,c-1)
let str_after = strpart(getline(l+k),c)
if char0 =~ '\d'
let char1 = char0 + k
else
let char1 = nr2char(char2nr(char0)+k)
endif
call setline(l+k, str_before . char1 . str_after)
endfor
endfunction
列选中A,按F3,就可以变成右边的样子
如果是1,则数字递增
友情提醒:字母若超过Z会出现ASCⅡ码后面的字符