Allow to exclude by buffer types (#235)

* Filter by buftype

* Add docs

* Typo
This commit is contained in:
Santos Gallegos
2018-02-22 03:31:01 -05:00
committed by Yggdroot
parent 86de3cdbda
commit 7a7e368205
2 changed files with 13 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ let g:indentLine_enabled = get(g:, 'indentLine_enabled', 1)
let g:indentLine_fileType = get(g:, 'indentLine_fileType', [])
let g:indentLine_fileTypeExclude = get(g:, 'indentLine_fileTypeExclude', [])
let g:indentLine_bufNameExclude = get(g:, 'indentLine_bufNameExclude', [])
let g:indentLine_bufTypeExclude = get(g:, 'indentLine_bufTypeExclude', [])
let g:indentLine_showFirstIndentLevel = get(g:, 'indentLine_showFirstIndentLevel', 0)
let g:indentLine_maxLines = get(g:, 'indentLine_maxLines', 3000)
let g:indentLine_setColors = get(g:, 'indentLine_setColors', 1)
@@ -210,6 +211,10 @@ function! s:Filter()
return 0
endif
if index(g:indentLine_bufTypeExclude, &buftype) != -1
return 0
endif
if len(g:indentLine_fileType) != 0 && index(g:indentLine_fileType, &filetype) == -1
return 0
endif

View File

@@ -99,7 +99,14 @@ g:indentLine_fileTypeExclude *g:indentLine_fileTypeExclude*
When opening these types of files, the plugin is disabled by
default.
e.g. let g:indentLine_fileTypeExclude = ['text', 'sh']
Default value is [] which means no file types is excluded.
Default value is [] which means no file types are excluded.
g:indentLine_bufTypeExclude *g:indentLine_bufTypeExclude*
This variable specify a list of buffer types.
When opening these types of buffers, the plugin is disabled
by default.
e.g. let g:indentLine_bufTypeExclude = ['help', 'terminal']
Default value is [] which means no buffer type is excluded.
g:indentLine_bufNameExclude *g:indentLine_bufNameExclude*
This variable specify a list of buffer names, which can be