-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
27 lines (15 loc) · 988 Bytes
/
README
File metadata and controls
27 lines (15 loc) · 988 Bytes
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
This is a mirror of http://www.vim.org/scripts/script.php?script_id=1171
This script provides a command which will attempt to guess the correct indent settings for an open file, for use when there is no modeline available. Note that this is a pure vim implementation, and doesn't require any external applications or interpreters.
Usage:
:DetectIndent
May also be used in an autocommand, for example:
:autocmd BufReadPost * :DetectIndent
Options:
To prefer 'expandtab' to 'noexpandtab' when no detection is possible:
:let g:detectindent_preferred_expandtab = 1
To specify a preferred indent level when no detection is possible:
:let g:detectindent_preferred_indent = 4
Notes:
Detection is by no means perfect. It won't work if files use especially perverse combinations of spaces and tabs, or weird tab widths. Bug reports and patches encouraged...
Keeping things up to date on vim.org is a nuisance. For the latest version, visit:
http://github.com/ciaranm/detectindent