Skip to content

Commit 5111d5b

Browse files
sominialerque
authored andcommitted
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.
1 parent 36b2d8d commit 5111d5b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

autoload/indent_guides.vim

+5
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ endfunction
284284
" Detect if any of the buffer filetypes should be excluded.
285285
"
286286
function! indent_guides#exclude_filetype() abort
287+
if exists('g:indent_guides_exclude_buftype')
288+
if g:indent_guides_exclude_buftype && &buftype != ''
289+
return 1
290+
endif
291+
endif
287292
for ft in split(&ft, '\.')
288293
if index(g:indent_guides_exclude_filetypes, ft) > -1
289294
return 1

doc/indent_guides.txt

+8
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,14 @@ Default: 0. Values: 0 or 1.
170170
let g:indent_guides_enable_on_vim_startup = 0
171171
<
172172

173+
------------------------------------------------------------------------------
174+
*'indent_guides_exclude_buftype'*
175+
Use this option to try and disable the plugin on non-file buffers
176+
177+
Default: 0. Values: 0 or 1
178+
>
179+
let g:indent_guides_exclude_buftype = 0
180+
<
173181
------------------------------------------------------------------------------
174182
*'indent_guides_exclude_filetypes'*
175183
Use this option to specify a list of filetypes to disable the plugin for.

0 commit comments

Comments
 (0)