Add option to disable automatic detection (#36)

Auto detection can be disabled by setting:

  let g:sleuth_automatic = 0
This commit is contained in:
Gaute Hope 2017-03-29 09:41:18 +02:00 committed by Tim Pope
parent 5cc6548b2e
commit 2826bc17ef
2 changed files with 8 additions and 1 deletions

View File

@ -17,4 +17,11 @@ current and parent directories. In lieu of adjusting 'softtabstop',
*:Sleuth*
:Sleuth Manually detect indentation.
SETTINGS *sleuth-settings*
Automatic detection of buffer options can be controlled with:
>
let g:sleuth_automatic = 0
<
vim:tw=78:et:ft=help:norl:

View File

@ -163,7 +163,7 @@ endif
augroup sleuth
autocmd!
autocmd FileType * call s:detect()
autocmd FileType * if get(g:, 'sleuth_automatic', 1) | call s:detect() | endif
augroup END
command! -bar -bang Sleuth call s:detect()