Vim script for automatically detecting indent settings
The original plugin (the one in the official Vim plugin repository) seems to be abandoned, so this is a fork of raymond-w-ko’s version, which has, among other things, much more robust detection of indentation style. His README said this:
I merged all the forks that I found were semi-reasonable in the GitHub network graph. This was done in less than 15 minutes, so expect bugs!
My fork’s additions:
- set 0 for
shiftwidth
and -1 forsofttabstop
when supported, to make it easier for users to manually change indentation - treat a
g:detectindent_preferred_expandtab
0 value as signifying a desired default ofnoexpandtab
- slightly better wording of verbose log messages
- various refactorings
- style and formatting fixes in code and documentation
Feel free to submit pull requests or file issues.