Add option g:indent_guides_exclude_filetypes.

For specifying a list of filetypes to disable the plugin for.

Closes #20 and #26.
This commit is contained in:
Nate Kane
2013-03-06 21:57:33 +10:00
parent 0421be28b3
commit 997bede1b5
3 changed files with 33 additions and 1 deletions

View File

@@ -33,6 +33,11 @@ endfunction
function! indent_guides#enable()
let g:indent_guides_autocmds_enabled = 1
if indent_guides#exclude_filetype()
call indent_guides#clear_matches()
return
end
call indent_guides#init_script_vars()
call indent_guides#highlight_colors()
call indent_guides#clear_matches()
@@ -261,3 +266,15 @@ function! indent_guides#indent_highlight_pattern(indent_pattern, column_start, i
let l:pattern .= '\ze'
return l:pattern
endfunction
"
" Detect if any of the buffer filetypes should be excluded.
"
function! indent_guides#exclude_filetype()
for ft in split(&ft, ',')
if index(g:indent_guides_exclude_filetypes, ft) > -1
return 1
end
endfor
return 0
endfunction