From 9b56828c573910e4210fa05138ddf5aabb8e4b03 Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Wed, 13 May 2020 14:58:26 +0200 Subject: [PATCH] contrib/vimrc: Reduce textwidth for commit messages * vimrc: Reduce textwidth to 72 for Git commit messages. --- contrib/ChangeLog | 4 ++++ contrib/vimrc | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/contrib/ChangeLog b/contrib/ChangeLog index f07b049535b..352f650ff41 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,7 @@ +2020-05-13 Patrick Palka + + * vimrc: Reduce textwidth to 72 for Git commit messages. + 2020-05-13 Martin Liska * gcc-changelog/git_check_commit.py: Add default argument HEAD diff --git a/contrib/vimrc b/contrib/vimrc index fa0208d5beb..c207eead2e4 100644 --- a/contrib/vimrc +++ b/contrib/vimrc @@ -39,7 +39,11 @@ function! SetStyle() setlocal shiftwidth=2 setlocal noexpandtab endif - setlocal textwidth=80 + if &filetype == "gitcommit" + setlocal textwidth=72 + else + setlocal textwidth=80 + endif setlocal formatoptions-=ro formatoptions+=cqlt if index(l:c_exts, l:ext) != -1 setlocal cindent -- 2.30.2