From 10a2f0b0dd95c4e7a53b3bc18ee1129093c74026 Mon Sep 17 00:00:00 2001 From: haya14busa Date: Sun, 11 May 2014 00:34:07 +0900 Subject: [PATCH] Add :IndentLinesEnable and :IndentLinesDisable --- after/plugin/indentLine.vim | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index fc78278..2982d98 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -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 ResetWidth() command! IndentLinesToggle call IndentLinesToggle() +command! IndentLinesEnable call IndentLinesEnable() +command! IndentLinesDisable call IndentLinesDisable() " vim:et:ts=4:sw=4:fdm=marker:fmr={{{,}}}