The documented setting, 'g:guessindent_prefer_tabs' was non-functional in favor of a differently named setting. Now the code agrees with the documentation.
softtabstop is useful when expandtab is set because it makes the tab key a useful tool for indenting. When noexpandtab is set, it causes the tab, >, and < keys to insert mixed spaces for indentation which isn't a useful behavior. Setting to 0 disables this and allows true tab characters to be used. Fixes #1
1. Never set tabstop: just let the default from vimrc take priority. The only interesting case is when leading tabs and spaces are mixed, and in my experience the only sane guess in that situation is "4". This change removes the need for g:detectindent_preferred_indent 2. Count how many times we see leading tabs vs. leading spaces, so that we can make a better guess about what the file is using. This change makes g:detectindent_preferred_expandtab just a hint as to which setting to lean towards when guessing. 3. If we don't see any leading tabs or spaces, don't do anything. Users can set filetype defaults easily for this kind of situation anyways.
…put for debugging purposes
Add `-bar` to definition of `:DetectIndent`.
This addresses issue #3 (https://github.com/ciaranm/detectindent/issues/closed#issue/3).
…ile is very large. Default number of lines to analyse is 1024. Default can be changed with g:detectindent_max_lines_to_analyse variable. Signed-off-by: Pauli Nieminen <email@example.com>
Paying attention solely to lines with actual content should improve the heuristics as those lines are more likely to be paid due attention. Lines of pure whitespace probably go unnoticed by most people and are therefore less likely to follow the proper indent style.