- detect mixed indent(indent with both spaces and tabs) and echo warnning on
bufEnter
andbufWrite
automatically. - switch setting about indenting to fit the current indenting style automatically.
- detecting time is limited, so you don't need to worry about opening huge files.
- the options decided by this plugin are
expandtab
smarttab
tabstop
shiftwidth
softtabstop
, and is setted viasetlocal
. - your own setting about indenting is also used as default when the indenting style is not decided. (when you create an empty file or enter a file which occurs no leading spaces or tabs)
- this plugin will do nothing when you open an readonly file (
:echo &readonly
to check that), so that you can open help files without warnning.
Bundle 'luochen1990/indent-detector.vim'
put indentdetector.vim
to directory ~/.vim/plugin
or vimfiles/plugin
remenber to restart your vim after installation
let g:indent_detector_tabstop=
- set tabstop, default is global tabstop settingslet g:indent_detector_shiftwidth=
- set shiftwidth, default is global shiftwidth settingslet g:indent_detector_softtabstop=
- set softtabstop, default is global softtabstop settingslet g:indent_detector_echolevel_enter=
- default is 3let g:indent_detector_echolevel_write=
- default is 2
echolevel: 0 - none; 1 - error; 2 - warnning; 3 - info (all)