-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvim-detect-indent.txt
153 lines (119 loc) · 6.37 KB
/
vim-detect-indent.txt
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
*vim-detect-indent.txt*
A Vim/Neovim plugin to detect indentation options
automatically powered by denops.vim
==============================================================================
Table of Contents *vim-detect-indent-table-of-contents*
Summary |vim-detect-indent-summary|
Commands |vim-detect-indent-commands|
Functions |vim-detect-indent-functions|
Variables |vim-detect-indent-variables|
Similar Plugins |vim-detect-indent-similar-plugins|
Installation |vim-detect-indent-installation|
Requirements |vim-detect-indent-requirements|
==============================================================================
Summary *vim-detect-indent-summary*
*vim-detect-indent* is a Vim/Neovim plugin to detect indentation options
automatically powered by denops.vim.
==============================================================================
Commands *vim-detect-indent-commands*
|vim-detect-indent| provides 2 commands: |:DetectIndent| and
|:DetectIndentRestore|.
*:DetectIndent*
:DetectIndent
Calls |detect_indent#detect()|.
*:DetectIndentRestore*
:DetectIndentRestore
Calls |detect_indent#restore()|.
==============================================================================
Functions *vim-detect-indent-functions*
*detect_indent#detect()* *b:detect_indent*
detect_indent#detect()
Detects and sets the current buffer’s indentation options, e.g.,
|'expandtab'| or |'shiftwidth'|. And also sets a buffer-local variable
`b:detect_indent` for restoring the state.
*detect_indent#restore*
detect_indent#restore()
Restores the state before previous calling |detect_indent#detect()|.
==============================================================================
Variables *vim-detect-indent-variables*
*g:detect_indent_default_commands*
g:detect_indent_default_commands
Whether to define default commands |:DetectIndent| and
|:DetectIndentRestore| or not. By default, |vim-detect-indent| defines
the commands. Set this variable `0` if you don’t use the commands.
Default: `1`
*g:detect_indent_default_autocmds*
g:detect_indent_default_autocmds
Whether to define default autocommands to execute |:DetectIndent| or
not. By default, |vim-detect-indent| defines a autocommand to execute
|:DetectIndent| on |FileType| event. Set this variable `0` if you
don’t use the autocommand.
Default: `1`
*g:detect_indent#detect_once*
g:detect_indent#detect_once
Whether to skip detecting indentation options if the current buffer’s
have been already detected. By default, |vim-detect-indent| detects
the buffer’s indentation options only once. Set this variable `0` if
you prefer to indentation options detected multiple times.
Default: `1`
*g:detect_indent#ignore_filetypes*
g:detect_indent#ignore_filetypes
Filetypes list to skip detecting indentation options. By default,
|vim-detect-indent| detects all |'filetype'| buffer’s indentation
options. Set this variable if you want to make |vim-detect-indent|
skip detecting for specific filetypes.
Default: `[]`
Example: `["", "gitcommit", "startify"]`
*g:detect_indent#ignore_buftypes*
g:detect_indent#ignore_buftypes
Buftypes list to skip detecting indentation options. By default,
|vim-detect-indent| detects all |'buftype'| buffer’s indentation
options. Set this variable if you want to make |vim-detect-indent|
skip detecting for specific buftypes.
Default: `[]`
Example: `["nofile", "quickfix", "terminal"]`
*g:detect_indent#silence_warnings*
g:detect_indent#silence_warnings
Whether to silence warning logs or not. For example,
|vim-detect-indent| shows warnings if detecting indentation fails. Set
this variable `1` (`v:true`) if you don’t want to see such warnings.
Default: `0` (`v:false`)
*g:detect_indent#silence_information*
g:detect_indent#silence_information
Whether to silence information logs or not. For example,
|vim-detect-indent| shows indentation information after detecting
indentation. Set this variable `1` (`v:true`) if you don’t want to see
such information.
Default: `0` (`v:false`)
==============================================================================
Similar Plugins *vim-detect-indent-similar-plugins*
There are great existing similar plugins. For example:
* vim-findent (https://github.com/lambdalisue/vim-findent)
* vim-sleuth (https://github.com/tpope/vim-sleuth)
* detectindent (https://github.com/ciaranm/detectindent)
*vim-detect-indent-algorithm*
|vim-detect-indent| uses simpler algorithm: what majority of indented lines
are indented with. If indented with the hard tab, `noexpandtab` will be set.
If indented with spaces, `expandtab` and `shiftwidth={n}` will be set.
|vim-detect-indent|’s behavior is easy to expect due to its simple algorithm.
|vim-detect-indent| doesn’t cover all indentation cases but aims to work nice
in many common cases.
==============================================================================
Installation *vim-detect-indent-installation*
For dein.vim (https://github.com/Shougo/dein.vim) users:
>
call dein#add("kg8m/vim-detect-indent")
<
For vim-plug (https://github.com/junegunn/vim-plug) users:
>
Plug 'kg8m/vim-detect-indent'
<
==============================================================================
Requirements *vim-detect-indent-requirements*
* Deno
* denops.vim
* Vim or Neovim
Supported version of Deno, Vim, and Neovim depends on denops.vim. Please see
denops.vim’s README (https://github.com/vim-denops/denops.vim#readme).
==============================================================================
vim:tw=78:ts=8:ft=help:norl:noet:fen:fdl=0: