mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-10 04:23:51 -05:00
Add missing functions from Sleuth, #541
This commit is contained in:
@@ -1923,10 +1923,24 @@ if !has_key(s:disabled_packages, 'autoindent')
|
|||||||
|
|
||||||
setglobal smarttab
|
setglobal smarttab
|
||||||
|
|
||||||
|
function! SleuthIndicator() abort
|
||||||
|
let sw = &shiftwidth ? &shiftwidth : &tabstop
|
||||||
|
if &expandtab
|
||||||
|
return 'sw='.sw
|
||||||
|
elseif &tabstop == sw
|
||||||
|
return 'ts='.&tabstop
|
||||||
|
else
|
||||||
|
return 'sw='.sw.',ts='.&tabstop
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
augroup polyglot
|
augroup polyglot
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd FileType * call s:detect_indent()
|
autocmd FileType * call s:detect_indent()
|
||||||
|
autocmd User Flags call Hoist('buffer', 5, 'SleuthIndicator')
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
|
command! -bar -bang Sleuth call s:detect_indent()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" restore Vi compatibility settings
|
" restore Vi compatibility settings
|
||||||
|
|||||||
Reference in New Issue
Block a user