This commit is contained in:
Yggdroot
2013-04-01 19:00:16 +08:00
parent 919e0bf4e0
commit 7be63e55a7
2 changed files with 23 additions and 6 deletions

View File

@@ -1,9 +1,9 @@
" Script Name: indentLine.vim " Script Name: indentLine.vim
" Version: 1.0.5 " Version: 1.0.5
" Last Change: March 5, 2013 " Last Change: April 1, 2013
" Author: Yggdroot <archofortune@gmail.com> " Author: Yggdroot <archofortune@gmail.com>
" "
" Description: To show the indent lines " Description: To show the indention levels with thin vertical lines
"{{{1 global variables "{{{1 global variables
if !has("conceal") || exists("g:indentLine_loaded") if !has("conceal") || exists("g:indentLine_loaded")
@@ -44,6 +44,10 @@ if !exists("g:indentLine_fileTypeExclude")
let g:indentLine_fileTypeExclude = [] let g:indentLine_fileTypeExclude = []
endif endif
if !exists("g:indentLine_bufNameExclude")
let g:indentLine_bufNameExclude = []
endif
if !exists("g:indentLine_showFirstIndentLevel") if !exists("g:indentLine_showFirstIndentLevel")
let g:indentLine_showFirstIndentLevel = 0 let g:indentLine_showFirstIndentLevel = 0
endif endif
@@ -122,6 +126,10 @@ function! <SID>Setup()
if !getbufvar("%","&hidden") || !exists("b:indentLine_set") if !getbufvar("%","&hidden") || !exists("b:indentLine_set")
let b:indentLine_set = 1 let b:indentLine_set = 1
if &ft == ""
call <SID>InitColor()
endif
if index(g:indentLine_fileTypeExclude, &ft) != -1 if index(g:indentLine_fileTypeExclude, &ft) != -1
return return
endif endif
@@ -130,6 +138,12 @@ function! <SID>Setup()
return return
end end
for name in g:indentLine_bufNameExclude
if matchstr(bufname(''), name) == bufname('')
return
endif
endfor
if !exists("b:indentLine_enabled") if !exists("b:indentLine_enabled")
let b:indentLine_enabled = g:indentLine_enabled let b:indentLine_enabled = g:indentLine_enabled
endif endif
@@ -137,10 +151,6 @@ function! <SID>Setup()
if b:indentLine_enabled if b:indentLine_enabled
call <SID>SetIndentLine() call <SID>SetIndentLine()
endif endif
if &ft == ""
call <SID>InitColor()
endif
endif endif
endfunction endfunction

View File

@@ -77,6 +77,13 @@ g:indentLine_fileTypeExclude *g:indentLine_fileTypeExclude*
e.g. let g:indentLine_fileType = ['text', 'sh'] e.g. let g:indentLine_fileType = ['text', 'sh']
Default value is [] which means no file types is excluded. Default value is [] which means no file types is excluded.
g:indentLine_bufNameExclude *g:indentLine_bufNameExclude*
This variable specify a list of buffer names, which can be
regular expression. If the buffer's name fall into this list,
the indentLine won't display.
e.g. let g:indentLine_bufNameExclude = ['_.*', 'NERD_tree.*']
Default value is [].
============================================================================== ==============================================================================
COMMANDS *indentLine-commands* COMMANDS *indentLine-commands*