diff options
Diffstat (limited to 'doc/detect_indent.txt')
-rw-r--r-- | doc/detect_indent.txt | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/doc/detect_indent.txt b/doc/detect_indent.txt new file mode 100644 index 0000000..7ba0fa8 --- /dev/null +++ b/doc/detect_indent.txt @@ -0,0 +1,48 @@ +*detect_indent.txt* For Vim version 7.0 Last change: 2020 May 30 + +DESCRIPTION *detect_indent* + +This plugin provides a user command to be run on a buffer after filetype +detection, applying some simple heuristics to adjust indentation settings if +the user's settings don't appear to match the buffer's settings. It pivots on +the value of 'expandtab'. + +If changing from 'noexpandtab' to 'expandtab', a guess at an appropriate value +for 'shiftround' is attempted. It may not be accurate. + +REQUIREMENTS *detect_indent-requirements* + +This plugin is only available if 'compatible' is not set. It also requires +the |+user_commands| feature. + +COMMANDS *detect_indent-commands* + + *:DetectIndent* +Run the plugin's detection manually if needed. You will probably only want to +do this for debugging purposes, as the command should be run after |FileType| +hooks. + +OPTIONS *detect_indent-options* + + *g:detect_indent_limit* +Set `g:detect_indent_limit` to the upper limit on the number of lines checked +to detect the indent. The default value is 1024. + + *g:detect_indent_confidence* +Set `g:detect_indent_confidence` to the minimum percentage of space indent +levels of the total indented lines sufficient to adopt that value for +'shiftround'. If almost all of a thousand-line file is indented by multiples +of 4 spaces, for example, but there is a single line with 3 spaces by +accident, this threshold should ignore such an outlier. The default is +5 (percent). + +AUTHOR *detect_indent-author* + +Written and maintained by Tom Ryder <tom@sanctum.geek.nz>, who has friends who +use tabs where he doesn't, and vice-versa. + +LICENSE *detect_indent-license* + +Licensed for distribution under the same terms as Vim itself (see |license|). + + vim:tw=78:ts=8:ft=help:norl: |