Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
57 lines (43 sloc) 2.74 KB
*guessindent.txt* The Guess Indent Plugin 1.0, October 1, 2012
Author: Alex Ogier <alex.ogier.NO@SPAM.gmail.com>
==============================================================================
1. Contents *guessindent* *guessindent-contents*
1. Contents |guessindent-contents|
2. :DetectIndent Command |:GuessIndent|
Settings |guessindent-settings|
3. GuessIndent ChangeLog |guessindent-changelog|
==============================================================================
2. :GuessIndent Command *:GuessIndent*
The :GuessIndent command tries to determine whether the active file
uses tabs or spaces for indentation as a convention. If the file
appers to use spaces for indentation, the plugin will try to
intelligently set the 'shiftwidth' and 'softtabstop' options.
You can run this command automatically every time a file is loaded.
To do that, set: >
autocmd BufReadPost * :GuessIndent
< in your |vimrc| file.
Settings *guessindent-settings*
If at least 3/4 of the lines in the active file appear to use spaces
for indentation, then 'expandtab' will be set. If at least 3/4 of
the lines in the active file use tabs for indentation, 'noexpandtab'
will be set. If no tabs or spaces are used (for example if the file
is new) then the command does nothing. If there is a roughly even mix
then the file is considered to be ambiguous.
If the file sometimes uses spaces and sometimes uses tabs for
indentation ambiguously, spaces are arbitrarily chosen as the
indentation method and 'expandtab' is set. If you prefer to use
tabs in this case and set 'noexpandtab', set: >
let g:guessindent_prefer_tabs = 1
< in your |vimrc| file.
For performance reasons, |:GuessIndent| reads a limited number of
lines from the active file. The default is currently to read a
maximum of 1024 lines. To change this maximum, set: >
let g:guessindent_max_lines_to_analyse = 2048
< in your |vimrc| file.
==============================================================================
3. GuessIndent ChangeLog *guessindent-changelog*
v1.0 (20121001)
* forked DetectIndent plugin by Ciaran McCreesh from
https://github.com/ciaranm/detectindent
==============================================================================
vim:tw=78:et:sw=4:sts=4:ft=help