标签:
" zsl_log.vim
" Version: 1.0
if exists("g:zsl_loaded_log") || &cp || v:version < 700
finish
endif
let g:zsl_loaded_log = 1
"基础函数
function AddLog()
let zslinde = max([indent(line(".")), indent(line(".")+1)])
let log = ‘android.util.Log.e("zhangshuli|exchange", "");‘
let curfile = expand("%:t:r")
let logline = line(".") + 1
let log = substitute(log, "exchange", curfile."|".logline, ‘‘)
call append(line("."), log)
echo indent(line("."))
echo indent(line(".")+1)
echo zslinde
+1
let col = stridx(log, ";")
call cursor(".", col-1)
call s:SetIndent(zslinde, line("."))
endfunction
"设置缩进
function! s:SetIndent(inde,curline)
if a:inde == 0
left 0
elseif a:inde == 2
left 2
elseif a:inde == 4
left 4
elseif a:inde == 6
left 6
elseif a:inde == 8
left 8
elseif a:inde == 10
left 10
elseif a:inde == 12
left 12
elseif a:inde == 14
left 14
elseif a:inde == 16
left 16
elseif a:inde == 18
left 18
elseif a:inde == 20
left 20
elseif a:inde == 22
left 22
elseif a:inde == 24
left 24
elseif a:inde == 26
left 26
elseif a:inde == 28
left 28
elseif a:inde == 30
left 30
endif
endfunction
标签:
原文地址:http://www.cnblogs.com/zhangshuli-1989/p/zsl_2016_04_010233.html