Skip to content

Commit feea1b4

Browse files
saccarosiumchrisbra
authored andcommitted
Add an .editorconfig file to repository
This commit tries to use an editorconfig file to ensure the same settings across editors while contributing to the vim repository. The rules are based of the guidelines defined in `runtime/doc/develop.txt`. Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 1083cae commit feea1b4

3 files changed

Lines changed: 27 additions & 1 deletion

File tree

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# https://spec.editorconfig.org/#supported-pairs
2+
root = true
3+
4+
[*]
5+
indent_style = tab
6+
tab_width = 8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[*.{c,h,proto}]
11+
indent_size = 4
12+
13+
[*.{md,yml,sh,bat}]
14+
# This will become the default after we migrate the codebase
15+
indent_style = space
16+
indent_size = 2
17+
18+
[*.md]
19+
# Markdown uses trailing whitespaces to do an hard line break
20+
# https://spec.commonmark.org/0.31.2/#hard-line-breaks
21+
trim_trailing_whitespace = false

Filelist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ SRC_ALL = \
1818
.hgignore \
1919
.appveyor.yml \
2020
.codecov.yml \
21+
.editorconfig \
2122
ci/appveyor.bat \
2223
ci/config.mk*.sed \
2324
ci/if_ver*.vim \

runtime/doc/develop.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*develop.txt* For Vim version 9.1. Last change: 2024 Oct 31
1+
*develop.txt* For Vim version 9.1. Last change: 2024 Nov 11
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -166,6 +166,10 @@ stick to these rules, to keep the sources readable and maintainable.
166166

167167
This list is not complete. Look in the source code for more examples.
168168

169+
The code repository contains an editorconfig file, that can be used together
170+
with the distributed editorconfig plugin |editorconfig-install| to ensure the
171+
recommended style is followed.
172+
169173

170174
MAKING CHANGES *style-changes*
171175

0 commit comments

Comments
 (0)