mirror of
https://github.com/Yggdroot/indentLine.git
synced 2025-12-07 20:54: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
|
endif
|
||||||
|
|
||||||
if !exists("g:indentLine_fileType")
|
if !exists("g:indentLine_fileType")
|
||||||
let g:indentLine_fileType = "*"
|
let g:indentLine_fileType = []
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists("g:indentLine_fileTypeExclude")
|
if !exists("g:indentLine_fileTypeExclude")
|
||||||
let g:indentLine_fileTypeExclude = ""
|
let g:indentLine_fileTypeExclude = []
|
||||||
endif
|
endif
|
||||||
|
|
||||||
set conceallevel=1
|
set conceallevel=1
|
||||||
@@ -105,10 +105,14 @@ function! <SID>Setup()
|
|||||||
if !exists("b:indentLine_set")
|
if !exists("b:indentLine_set")
|
||||||
let b:indentLine_set = 1
|
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
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if len(g:indentLine_fileType) != 0 && index(g:indentLine_fileType, &ft) == -1
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
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
|
||||||
@@ -124,8 +128,8 @@ function! <SID>Setup()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
"{{{1 commands
|
"{{{1 commands
|
||||||
exec 'autocmd BufWinEnter '.g:indentLine_fileType.' call <SID>Setup()'
|
exec 'autocmd BufWinEnter * call <SID>Setup()'
|
||||||
exec 'autocmd BufRead,ColorScheme '.g:indentLine_fileType.' call <SID>InitColor()'
|
exec 'autocmd BufRead,ColorScheme * call <SID>InitColor()'
|
||||||
|
|
||||||
command! -nargs=? IndentLinesReset call <SID>ResetWidth(<f-args>)
|
command! -nargs=? IndentLinesReset call <SID>ResetWidth(<f-args>)
|
||||||
command! IndentLinesToggle call <SID>IndentLinesToggle()
|
command! IndentLinesToggle call <SID>IndentLinesToggle()
|
||||||
|
|||||||
@@ -51,18 +51,18 @@ g:indentLine_enabled *g:indentLine_enabled*
|
|||||||
Default value is 1.
|
Default value is 1.
|
||||||
|
|
||||||
g:indentLine_fileType *g:indentLine_fileType*
|
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
|
When opening these types of files, the plugin is enabled by
|
||||||
default.
|
default.
|
||||||
e.g. let g:indentLine_fileType = '*.c,*.h'
|
e.g. let g:indentLine_fileType = ['c', 'cpp']
|
||||||
Default value is "*" which means all file types is supported.
|
Default value is [] which means all file types is supported.
|
||||||
|
|
||||||
g:indentLine_fileTypeExclude *g:indentLine_fileTypeExclude*
|
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
|
When opening these types of files, the plugin is disabled by
|
||||||
default.
|
default.
|
||||||
e.g. let g:indentLine_fileType = '*.txt,*.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.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
COMMANDS *indentLine-commands*
|
COMMANDS *indentLine-commands*
|
||||||
|
|||||||
Reference in New Issue
Block a user