summaryrefslogtreecommitdiff
path: root/doc/detectindent.txt
blob: 524b8b60525a4678db5a5cd95155d88464bb840a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
*detectindent.txt*	The Detect Indent Plugin	     1.0, Jan 04, 2005

Author:  Ciaran McCreesh <ciaran.mccreesh at googlemail.com>

==============================================================================
1. Contents				*detectindent* *detectindent-contents*

    1. Contents                                    |detectindent-contents|
    2. :DetectIndent Command                               |:DetectIndent|
	Settings                                   |detectindent-settings|
    3. Uptime ChangeLog                                 |uptime-changelog|

==============================================================================
2. :DetectIndent Command				       *:DetectIndent*

	The :DetectIndent command tries to intelligently set the 'shiftwidth',
	'expandtab' and 'tabstop' options based upon the existing settings in
	use in the active file.

    Settings					       *detectindent-settings*

	When the correct value for 'expandtab' cannot be determined, it will
	usually retain its existing value. To specify that 'expandtab' should
	be used where autodetection is impossible, set: >
		:let g:detectindent_preferred_expandtab = 1
<	in your |vimrc| file.

	To set a preferred value for 'shiftwidth' and 'tabstop' when they
	cannot be automatically detected, set: >
		:let g:detectindent_preferred_indent = 4
<	in your |vimrc| file.

	To use the preferred values when both tabs and spaces are detected,
	set: >
		:let g:detectindent_preferred_when_mixed = 1
<	in your |vimrc| file.

	To set limit for number of lines that will be analysed set: >
		:let g:detectindent_max_lines_to_analyse = 1024
<	in your |vimrc| file.

	To override |detectindent_preferred_expandtab| for specific filetypes
	(example: use 4-character tabstops with tabs for python) set: >
		:let b:detectindent_preferred_expandtab = 0
	    	:let b:detectindent_preferred_indent = 4
<	after/ftplugin/FILETYPENAMEHERE.vim (example:
	after/ftplugin/python.vim). Using 0 acts as if the option was never
	set.

==============================================================================
3. DetectIndent ChangeLog			      *detectindent-changelog*

	v1.1 (20150225)
	    * Add preferred_when_mixed.
	    * Add buffer-local options.
	v1.0 (20050105)
	    * initial release after discussion on irc.freenode.net:#vim

==============================================================================
vim:tw=78:ts=8:ft=help