File: editorconfig.txt

package info (click to toggle)
vim-editorconfig 0.3.3%2Bdfsg-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 152 kB
  • sloc: ruby: 95; makefile: 2; sh: 1
file content (221 lines) | stat: -rw-r--r-- 9,109 bytes parent folder | download | duplicates (3)
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
*editorconfig.txt*

File: editorconfig.txt
Version: 0.3.3
Maintainer: EditorConfig Team <http://editorconfig.org>
Description: EditorConfig vim plugin

License:
   Copyright (c) 2011-2015 EditorConfig Team
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are met:
   
   1. Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
   
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   POSSIBILITY OF SUCH DAMAGE.


CONTENTS~
                                            *editorconfig-contents*
----------------------------------------------------------------------------
1.  Overview                                 |editorconfig-overview|
2.  Installation                             |editorconfig-installation|
3.  Commands                                 |editorconfig-commands|
4.  Settings                                 |editorconfig-settings|
5.  Advanced                                 |editorconfig-advanced|


OVERVIEW~
                                            *editorconfig-overview*
----------------------------------------------------------------------------
This is the EditorConfig plugin for vim.


INSTALLATION~
                                            *editorconfig-installation*
----------------------------------------------------------------------------
Download the [EditorConfig core][] and follow the instructions in the README
and INSTALL files to install it.

Once EditorConfig core is installed, copy the `plugin/editorconfig.vim` file
to your `~/.vim/plugin` directory, `autoload/editorconfig.vim` to
`~/.vim/autoload`  and `doc/editorconfig.txt` to your `~/.vim/doc` directory
to install the EditorConfig plugin.

COMMANDS~
                                            *editorconfig-commands*
----------------------------------------------------------------------------

                                            *:EditorConfigReload*
Command:
    :EditorConfigReload

Reload the EditorConfig conf files. When `.editorconfig` files are modified,
this command could prevent you to reload the current edited file to load the
new configuration.

SETTINGS~
                                            *editorconfig-settings*
----------------------------------------------------------------------------
                                            *g:EditorConfig_core_mode*
Specify the mode of EditorConfig core. Generally it is OK to leave this option
empty. There are 3 modes currently: "external_command", "python_builtin",
"python_external".

    python_builtin:     Use the vim built-in python to run the python version
                        EditorConfig Core.
    python_external:    Use an external python interpreter to run the python
                        version EditorConfig Core.
    external_command:   Run external EditorConfig Core.

If "g:EditorConfig_core_mode" is not specified, this plugin will automatically
choose a mode that could work for you. The checking sequence is:
python_builtin, external_command, python_external.

                                            *g:EditorConfig_exclude_patterns*
This is a list contains file path patterns which will be ignored by
EditorConfig plugin. When the path of the opened buffer (i.e.
"expand('%:p')") matches any of the patterns in the list, EditorConfig will
not load for this file. The default is an empty list.

Example: Avoid loading EditorConfig for any remote files over ssh
>
 let g:EditorConfig_exclude_patterns = ['scp://.*']
<

                                            *g:EditorConfig_exec_path*
The file path to the EditorConfig core executable. You could set this value in
your |vimrc| like this:
>
 let g:EditorConfig_exec_path = 'Path to your EditorConfig Core executable'
<
The default value is empty.

This plugin will search through the following executables in order:

On UNIX:
    the value of g:EditorConfig_exec_path
    editorconfig
    /usr/local/bin/editorconfig
    /usr/bin/editorconfig
    /opt/bin/editorconfig
    /opt/editorconfig/bin/editorconfig
    editorconfig.py
    /usr/local/bin/editorconfig.py
    /usr/bin/editorconfig.py
    /opt/bin/editorconfig.py
    /opt/editorconfig/bin/editorconfig.py

On Windows:
    the value of g:EditorConfig_exec_path
    editorconfig
    C:\editorconfig\bin\editorconfig
    D:\editorconfig\bin\editorconfig
    E:\editorconfig\bin\editorconfig
    F:\editorconfig\bin\editorconfig
    C:\Program Files\editorconfig\bin\editorconfig
    D:\Program Files\editorconfig\bin\editorconfig
    E:\Program Files\editorconfig\bin\editorconfig
    F:\Program Files\editorconfig\bin\editorconfig
    editorconfig.py

                                            *g:EditorConfig_max_line_indicator*
The way to show the line where the maximal length is reached. Accepted values
are "line", "fill", otherwise there will be no max line indicator.

    "line": the right column of the max line length column will be
            highlighted, made possible by setting 'colorcolumn' to
            "max_line_length + 1".

    "fill": all the columns to the right of the max line length column will be
            highlighted, made possible by setting 'colorcolumn' to a list of
            numbers starting from "max_line_length + 1" to the number of
            columns on the screen.

    "none": no max line length indicator will be shown. This is the
            recommended value when you do not want any indicator to be shown,
            but values other than "line" or "fill" would also work as "none".

To set this option, add any of the following 3 lines to your |vimrc| file:

>
 let g:EditorConfig_max_line_indicator = "line"
 let g:EditorConfig_max_line_indicator = "fill"
 let g:EditorConfig_max_line_indicator = "none"
<

Default to "line".

                                            *g:EditorConfig_python_files_dir*
If the EditorConfig core mode is python_builtin or python_external (see
|g:EditorConfig_core_mode|), this variable is the directory where the plugin
looks for the python scripts. This could either be an abosolute path, or a
path relative to any of the directories in 'runtimepath'. The default value is
"plugin/editorconfig-core-py", which means all "plugin/editorconfig-core-py"
directory in 'runtimepath' will be searched.

                                            *g:EditorConfig_preserve_formatoptions*
Set this to 1 if you don't want your formatoptions modified when
max_line_length is set:
>
 let g:EditorConfig_preserve_formatoptions = 1
<

This option defaults to 0.

                                            *g:EditorConfig_verbose*
Set this to 1 if you want debug info printed:
>
 let g:EditorConfig_verbose = 1
<

ADVANCED~
                                            *editorconfig-advanced*
----------------------------------------------------------------------------
                                            *editorconfig-hook*
                                            *EditorConfig#AddNewHook()*
While this plugin offers several builtin supported properties (as mentioned
here: https://github.com/editorconfig/editorconfig-vim#supported-properties),
we are also able to add our own hooks to support additional EditorConfig
properties, including those not in the EditorConfig standard. For example, we
are working on an Objective-C project, and all our "*.m" files should be
Objective-C source files. However, vim sometimes detect "*.m" files as MATLAB
source files, which causes incorrect syntax highlighting, code indentation,
etc. To solve the case, we could write the following code into the |vimrc|
file:
>
 function! FiletypeHook(config)
     if has_key(a:config, 'vim_filetype')
         let &filetype = a:config['vim_filetype']
     endif

     return 0   " Return 0 to show no error happened
 endfunction

 call editorconfig#AddNewHook(function('FiletypeHook'))
<
And add the following code to your .editorconfig file:
>
 [*.m]
 vim_filetype = objc
<
Then try to open an Objective-C file, you will find the |filetype| is set to
"objc".

vim:ft=help:tw=78