"Zsl_log.vim
"version:1.0
If exists ("G:zsl_loaded_log") | | &CP | | V:version < 700
Finish
endif
Let G:zsl_loaded_log = 1
The underlying function
function Addlog ()
Let Zslinde = max ([Indent (".")], 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 ("."), 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
The Set indent
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
Quick Print log of vim script