Skip to content

Commit 2eb169b

Browse files
committed
editors: only extend line width to 119 for C and XML files
For all other files leave the line width at 79 as before. This is a good idea since we generally don't want text files such as catalog files, unit files or README/NEWS files to be line-broken at 119 since they are regularly browsed on text terminals. While we are at it, also add a couple of comments to the various files. (Note that .editorconfig doesn't carry line-width information, simply because the specification doesn't know the concept.)
1 parent 9c6d5a1 commit 2eb169b

File tree

4 files changed

+28
-7
lines changed

4 files changed

+28
-7
lines changed

.dir-locals.el

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,22 @@
22
; A list of (major-mode . ((var1 . value1) (var2 . value2)))
33
; Mode can be nil, which gives default values.
44

5+
; Note that we set a line width of 119 for .c and XML files, but for everything
6+
; else (such as journal catalog files, unit files, README files) we stick to a
7+
; more conservative 79 characters.
8+
9+
; NOTE: If you update this file make sure to update .vimrc and .editorconfig,
10+
; too.
11+
512
((nil . ((indent-tabs-mode . nil)
613
(tab-width . 8)
7-
(fill-column . 119)))
8-
(c-mode . ((c-basic-offset . 8)
14+
(fill-column . 79)))
15+
(c-mode . ((fill-column . 119)
16+
(c-basic-offset . 8)
917
(eval . (c-set-offset 'substatement-open 0))
1018
(eval . (c-set-offset 'statement-case-open 0))
1119
(eval . (c-set-offset 'case-label 0))
1220
(eval . (c-set-offset 'arglist-intro '++))
1321
(eval . (c-set-offset 'arglist-close 0))))
14-
(nxml-mode . ((nxml-child-indent . 2))))
22+
(nxml-mode . ((nxml-child-indent . 2)
23+
(fill-column . 119))))

.editorconfig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# EditorConfig configuration for systemd
22
# http://EditorConfig.org
33

4-
# top-most EditorConfig file
4+
# NOTE: If you update this file make sure to update .dir-locals.el and .vimrc,
5+
# too.
6+
7+
# Top-most EditorConfig file
58
root = true
69

710
# Unix-style newlines with a newline ending every file, utf-8 charset
@@ -11,7 +14,7 @@ insert_final_newline = true
1114
trim_trailing_whitespace = true
1215
charset = utf-8
1316

14-
# match config files, set indent to spaces with width of eight
17+
# Match config files, set indent to spaces with width of eight
1518
[*.{c,h}]
1619
indent_style = space
1720
indent_size = 8

.vimrc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@
33
" vimrc configuration file, including write operations and shell execution.
44
" You should consider setting 'set secure' as well, which is highly
55
" recommended!
6+
7+
" Note that we set a line width of 119 for .c and XML files, but for everything
8+
" else (such as journal catalog files, unit files, README files) we stick to a
9+
" more conservative 79 characters.
10+
11+
" NOTE: If you update this file make sure to update .dir-locals.el and
12+
" .editorconfig, too.
13+
614
set tabstop=8
715
set shiftwidth=8
816
set expandtab
917
set makeprg=GCC_COLORS=\ make
10-
set tw=119
18+
set tw=79
19+
au FileType xml set tw=119
20+
au FileType c set tw=119

catalog/systemd.catalog

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- fill-column: 79; indent-tabs-mode: nil -*-
21
# This file is part of systemd.
32
#
43
# Copyright 2012 Lennart Poettering

0 commit comments

Comments
 (0)