Add indicator for flagship.vim
This commit is contained in:
parent
2826bc17ef
commit
e3e5adfeaa
|
@ -17,11 +17,14 @@ current and parent directories. In lieu of adjusting 'softtabstop',
|
|||
*:Sleuth*
|
||||
:Sleuth Manually detect indentation.
|
||||
|
||||
*SleuthIndicator()*
|
||||
SleuthIndicator() Indicator for inclusion in 'statusline'. Or use
|
||||
flagship.vim to have it included automatically.
|
||||
|
||||
SETTINGS *sleuth-settings*
|
||||
|
||||
Automatic detection of buffer options can be controlled with:
|
||||
>
|
||||
let g:sleuth_automatic = 0
|
||||
<
|
||||
|
||||
vim:tw=78:et:ft=help:norl:
|
||||
|
|
|
@ -161,9 +161,21 @@ if !exists('g:did_indent_on')
|
|||
filetype indent on
|
||||
endif
|
||||
|
||||
function! SleuthIndicator() abort
|
||||
if &expandtab
|
||||
return 'sw='.&shiftwidth
|
||||
elseif &tabstop == &shiftwidth
|
||||
return 'ts='.&tabstop
|
||||
else
|
||||
return 'sw='.&shiftwidth.',ts='.&tabstop
|
||||
endif
|
||||
endfunction
|
||||
|
||||
augroup sleuth
|
||||
autocmd!
|
||||
autocmd FileType * if get(g:, 'sleuth_automatic', 1) | call s:detect() | endif
|
||||
autocmd FileType * call s:detect()
|
||||
autocmd User Flags call Hoist('buffer', 5, 'SleuthIndicator')
|
||||
augroup END
|
||||
|
||||
command! -bar -bang Sleuth call s:detect()
|
||||
|
|
Loading…
Reference in New Issue