mirror of
https://github.com/Yggdroot/indentLine.git
synced 2025-12-07 04:34:26 +08:00
Change the type of the variables for "FileType Supported" to list
This commit is contained in:
@@ -29,11 +29,11 @@ if !exists("g:indentLine_enabled")
|
||||
endif
|
||||
|
||||
if !exists("g:indentLine_fileType")
|
||||
let g:indentLine_fileType = "*"
|
||||
let g:indentLine_fileType = []
|
||||
endif
|
||||
|
||||
if !exists("g:indentLine_fileTypeExclude")
|
||||
let g:indentLine_fileTypeExclude = ""
|
||||
let g:indentLine_fileTypeExclude = []
|
||||
endif
|
||||
|
||||
set conceallevel=1
|
||||
@@ -105,10 +105,14 @@ function! <SID>Setup()
|
||||
if !exists("b:indentLine_set")
|
||||
let b:indentLine_set = 1
|
||||
|
||||
if !empty(filter(split(g:indentLine_fileTypeExclude, ','), 'v:val ==? "*.".expand("%:e:e") || v:val == "*"'))
|
||||
if index(g:indentLine_fileTypeExclude, &ft) != -1
|
||||
return
|
||||
endif
|
||||
|
||||
if len(g:indentLine_fileType) != 0 && index(g:indentLine_fileType, &ft) == -1
|
||||
return
|
||||
end
|
||||
|
||||
if !exists("b:indentLine_enabled")
|
||||
let b:indentLine_enabled = g:indentLine_enabled
|
||||
endif
|
||||
@@ -124,8 +128,8 @@ function! <SID>Setup()
|
||||
endfunction
|
||||
|
||||
"{{{1 commands
|
||||
exec 'autocmd BufWinEnter '.g:indentLine_fileType.' call <SID>Setup()'
|
||||
exec 'autocmd BufRead,ColorScheme '.g:indentLine_fileType.' call <SID>InitColor()'
|
||||
exec 'autocmd BufWinEnter * call <SID>Setup()'
|
||||
exec 'autocmd BufRead,ColorScheme * call <SID>InitColor()'
|
||||
|
||||
command! -nargs=? IndentLinesReset call <SID>ResetWidth(<f-args>)
|
||||
command! IndentLinesToggle call <SID>IndentLinesToggle()
|
||||
|
||||
@@ -51,18 +51,18 @@ g:indentLine_enabled *g:indentLine_enabled*
|
||||
Default value is 1.
|
||||
|
||||
g:indentLine_fileType *g:indentLine_fileType*
|
||||
This variable specify a list of comma separated file types.
|
||||
This variable specify a list of file types.
|
||||
When opening these types of files, the plugin is enabled by
|
||||
default.
|
||||
e.g. let g:indentLine_fileType = '*.c,*.h'
|
||||
Default value is "*" which means all file types is supported.
|
||||
e.g. let g:indentLine_fileType = ['c', 'cpp']
|
||||
Default value is [] which means all file types is supported.
|
||||
|
||||
g:indentLine_fileTypeExclude *g:indentLine_fileTypeExclude*
|
||||
This variable specify a list of comma separated file types.
|
||||
This variable specify a list of file types.
|
||||
When opening these types of files, the plugin is disabled by
|
||||
default.
|
||||
e.g. let g:indentLine_fileType = '*.txt,*.sh'
|
||||
Default value is "" which means no file types is excluded.
|
||||
e.g. let g:indentLine_fileType = ['text', 'sh']
|
||||
Default value is [] which means no file types is excluded.
|
||||
|
||||
==============================================================================
|
||||
COMMANDS *indentLine-commands*
|
||||
|
||||
Reference in New Issue
Block a user