From 2826bc17ef1820f68dfe6e43574a567e3c67a56d Mon Sep 17 00:00:00 2001 From: Gaute Hope Date: Wed, 29 Mar 2017 09:41:18 +0200 Subject: [PATCH] Add option to disable automatic detection (#36) Auto detection can be disabled by setting: let g:sleuth_automatic = 0 --- doc/sleuth.txt | 7 +++++++ plugin/sleuth.vim | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/sleuth.txt b/doc/sleuth.txt index e187cc9..ef5c7b3 100644 --- a/doc/sleuth.txt +++ b/doc/sleuth.txt @@ -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: diff --git a/plugin/sleuth.vim b/plugin/sleuth.vim index 276d9f7..bfba50e 100644 --- a/plugin/sleuth.vim +++ b/plugin/sleuth.vim @@ -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()