aboutsummaryrefslogtreecommitdiff
path: root/plugin/detect_indent.vim
blob: e75324aceda595feb18f7eda3487c838b298b75e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"
" detect_indent.vim: If 'expandtab' doesn't match the shape of the buffer's
" indents, switch it over, including a guess at 'shiftwidth' if switching it
" on.
"
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
if exists('loaded_detect_indent') || &compatible || v:version < 700
  finish
endif
let loaded_detect_indent = 1

" Set up a user command in case the user wants to set this manually
command! -bar DetectIndent
      \ call detect_indent#()

" Add hook for FileType event; this should load *after* filetype plugins
augroup detect_indent
  autocmd!
  autocmd FileType *
        \ DetectIndent
augroup END