Quick Print log of vim script

Source: Internet
Author: User

"Zsl_log.vim
"version:1.0

If exists ("G:zsl_loaded_log") | | &AMP;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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.