This commit is contained in:
Yggdroot
2014-04-17 18:19:38 +08:00
parent 57bf4eeae3
commit cc70416066

View File

@@ -1,7 +1,4 @@
" Script Name: indentLine.vim " Script Name: indentLine.vim
" Version: 1.0.5
" Last Change: April 1, 2013
" Author: Yggdroot <archofortune@gmail.com> " Author: Yggdroot <archofortune@gmail.com>
" "
" Description: To show the indention levels with thin vertical lines " Description: To show the indention levels with thin vertical lines
@@ -114,39 +111,43 @@ endfunction
"{{{1 function! s:Setup() "{{{1 function! s:Setup()
function! s:Setup() function! s:Setup()
if index(g:indentLine_fileTypeExclude, &filetype) isnot -1 if index(g:indentLine_fileTypeExclude, &filetype) isnot -1
return return
endif endif
if len(g:indentLine_fileType) isnot 0 && index(g:indentLine_fileType, &filetype) is -1 if len(g:indentLine_fileType) isnot 0 && index(g:indentLine_fileType, &filetype) is -1
return return
end end
for name in g:indentLine_bufNameExclude for name in g:indentLine_bufNameExclude
if matchstr(bufname(''), name) is bufname('') if matchstr(bufname(''), name) is bufname('')
return return
endif endif
endfor endfor
if ! exists("g:indentLine_noConcealCursor") if ! exists("b:indentLine_bufNr")
setlocal concealcursor=inc let b:indentLine_bufNr = bufnr('%')
endif let g:indentLine_bufNr = bufnr('%')
elseif g:indentLine_bufNr != bufnr('%') && &hidden
let g:indentLine_bufNr = bufnr('%')
return
endif
if ! exists("g:indentLine_noConcealCursor")
setlocal concealcursor=inc
endif
setlocal conceallevel=2 setlocal conceallevel=2
if !&hidden || !exists("b:indentLine_set") if &filetype is# ""
let b:indentLine_set = 1 call s:InitColor()
endif
if &filetype is# "" if ! exists("b:indentLine_enabled")
call s:InitColor() let b:indentLine_enabled = g:indentLine_enabled
endif endif
if ! exists("b:indentLine_enabled") if b:indentLine_enabled
let b:indentLine_enabled = g:indentLine_enabled call s:SetIndentLine()
endif
if b:indentLine_enabled
call s:SetIndentLine()
endif
endif endif
endfunction endfunction
@@ -155,7 +156,6 @@ augroup indentLine
autocmd! autocmd!
autocmd BufWinEnter * call <SID>Setup() autocmd BufWinEnter * call <SID>Setup()
autocmd BufRead,BufNewFile,ColorScheme * call <SID>InitColor() autocmd BufRead,BufNewFile,ColorScheme * call <SID>InitColor()
autocmd Syntax * call <SID>InitColor() | call <SID>SetIndentLine()
augroup END augroup END
"{{{1 commands "{{{1 commands