From 5111d5b10c92044ceeabc7e70e41b84d8c33d3a1 Mon Sep 17 00:00:00 2001 From: somini Date: Sun, 25 Oct 2015 23:14:24 +0000 Subject: [PATCH] feat: Add option to check buftype option before enabling Closes #101 Instead of only having a big list of "naughty" filetypes, have an option to check for the `buftype` and skip if set to anything. --- autoload/indent_guides.vim | 5 +++++ doc/indent_guides.txt | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/autoload/indent_guides.vim b/autoload/indent_guides.vim index e258a9c..7b739c3 100644 --- a/autoload/indent_guides.vim +++ b/autoload/indent_guides.vim @@ -284,6 +284,11 @@ endfunction " Detect if any of the buffer filetypes should be excluded. " function! indent_guides#exclude_filetype() abort + if exists('g:indent_guides_exclude_buftype') + if g:indent_guides_exclude_buftype && &buftype != '' + return 1 + endif + endif for ft in split(&ft, '\.') if index(g:indent_guides_exclude_filetypes, ft) > -1 return 1 diff --git a/doc/indent_guides.txt b/doc/indent_guides.txt index 82d955c..274482d 100644 --- a/doc/indent_guides.txt +++ b/doc/indent_guides.txt @@ -170,6 +170,14 @@ Default: 0. Values: 0 or 1. let g:indent_guides_enable_on_vim_startup = 0 < +------------------------------------------------------------------------------ + *'indent_guides_exclude_buftype'* +Use this option to try and disable the plugin on non-file buffers + +Default: 0. Values: 0 or 1 +> + let g:indent_guides_exclude_buftype = 0 +< ------------------------------------------------------------------------------ *'indent_guides_exclude_filetypes'* Use this option to specify a list of filetypes to disable the plugin for.