mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-11 13:03:50 -05:00
Move setting default tabstop to sensible part
This commit is contained in:
@@ -2670,18 +2670,34 @@ au FileType * au! polyglot-observer
|
|||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
|
|
||||||
if !has_key(g:polyglot_is_disabled, 'autoindent')
|
if !has_key(g:polyglot_is_disabled, 'sensible')
|
||||||
" Code below re-implements sleuth for vim-polyglot
|
" Use 2-spaces tab indentation by default
|
||||||
let g:loaded_sleuth = 1
|
|
||||||
|
|
||||||
if &tabstop == 8
|
if &tabstop == 8
|
||||||
let &tabstop = 2
|
let &tabstop = 2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Set shiftwidth to proper value as users often mix it with tabstop
|
||||||
if &shiftwidth > &tabstop
|
if &shiftwidth > &tabstop
|
||||||
let &shiftwidth = &tabstop
|
let &shiftwidth = &tabstop
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Use utf-8 encoding by default
|
||||||
|
set encoding=utf-8
|
||||||
|
|
||||||
|
" Reload unchanged files automatically.
|
||||||
|
set autoread
|
||||||
|
|
||||||
|
" Disable swap, it doesn't play well with autoread
|
||||||
|
set noswapfile
|
||||||
|
|
||||||
|
" Autoindent when starting new line, or using `o` or `O`.
|
||||||
|
set autoindent
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !has_key(g:polyglot_is_disabled, 'autoindent')
|
||||||
|
" Code below re-implements sleuth for vim-polyglot
|
||||||
|
let g:loaded_sleuth = 1
|
||||||
|
|
||||||
let s:default_shiftwidth = &shiftwidth
|
let s:default_shiftwidth = &shiftwidth
|
||||||
|
|
||||||
func! s:get_shiftwidth(indents) abort
|
func! s:get_shiftwidth(indents) abort
|
||||||
@@ -3559,20 +3575,6 @@ endfunc
|
|||||||
" We want vim-polyglot files to load only as fallback
|
" We want vim-polyglot files to load only as fallback
|
||||||
let &rtp = join(s:process_rtp(split(&rtp, ',')), ',')
|
let &rtp = join(s:process_rtp(split(&rtp, ',')), ',')
|
||||||
|
|
||||||
if !has_key(g:polyglot_is_disabled, 'sensible')
|
|
||||||
" Use utf-8 encoding by default
|
|
||||||
set encoding=utf-8
|
|
||||||
|
|
||||||
" Reload unchanged files automatically.
|
|
||||||
set autoread
|
|
||||||
|
|
||||||
" Disable swap, it doesn't play well with autoread
|
|
||||||
set noswapfile
|
|
||||||
|
|
||||||
" Autoindent when starting new line, or using `o` or `O`.
|
|
||||||
set autoindent
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Restore 'cpoptions'
|
" Restore 'cpoptions'
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
|
|||||||
Reference in New Issue
Block a user