Merge pull request #89 from haya14busa/patch-1

Add :IndentLinesEnable and :IndentLinesDisable
This commit is contained in:
Yggdroot
2014-05-11 16:22:13 +08:00
2 changed files with 22 additions and 3 deletions

View File

@@ -95,6 +95,17 @@ function! s:ResetWidth(...)
call s:SetIndentLine()
endfunction
"{{{1 function! s:IndentLinesEnable()
function! s:IndentLinesEnable()
call s:SetIndentLine()
endfunction
"{{{1 function! s:IndentLinesDisable()
function! s:IndentLinesDisable()
let b:indentLine_enabled = 0
syntax clear IndentLine
endfunction
"{{{1 function! s:IndentLinesToggle()
function! s:IndentLinesToggle()
if ! exists("b:indentLine_enabled")
@@ -102,10 +113,9 @@ function! s:IndentLinesToggle()
endif
if b:indentLine_enabled
let b:indentLine_enabled = 0
syntax clear IndentLine
call s:IndentLinesDisable()
else
call s:SetIndentLine()
call s:IndentLinesEnable()
endif
endfunction
@@ -161,6 +171,8 @@ augroup END
"{{{1 commands
command! -nargs=? IndentLinesReset call <SID>ResetWidth(<f-args>)
command! IndentLinesToggle call <SID>IndentLinesToggle()
command! IndentLinesEnable call <SID>IndentLinesEnable()
command! IndentLinesDisable call <SID>IndentLinesDisable()
" vim:et:ts=4:sw=4:fdm=marker:fmr={{{,}}}

View File

@@ -120,6 +120,13 @@ IndentLinesReset [number]
IndentLinesToggle
toggle the indent lines of the current buffer.
IndentLinesEnable
enable the indent lines of the current buffer.
IndentLinesDisable
disable the indent lines of the current buffer.
==============================================================================
FAQ *indentLine-faq*