From 0cc684f26b136029f4f49d808761d69228f42dff Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Sat, 25 Sep 2021 13:12:16 +0200 Subject: filetype: Set diff filetype for COMMIT_EDITMSG files This filename is set when writing a commit message in git. If you run git-commit with an --verbose option or if you just have set it in your git-config, that shows you the patch diff on bottom of the file. Unfortunately, now every patch file will set colorcolumn, but overall I think this is better than having duplicated lexers. --- lua/plugins/filetype.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lua/plugins') diff --git a/lua/plugins/filetype.lua b/lua/plugins/filetype.lua index 2ea5a06..18767ec 100644 --- a/lua/plugins/filetype.lua +++ b/lua/plugins/filetype.lua @@ -96,7 +96,8 @@ vis.ftdetect.filetypes = { ext = { "%.desktop$" }, }, diff = { - ext = { "%.diff$", "%.patch$", "%.rej$" }, + ext = { "%.diff$", "%.patch$", "%.rej$", "^COMMIT_EDITMSG$" }, + cmd = { "set colorcolumn 72" }, }, dmd = { ext = { "%.d$", "%.di$" }, @@ -159,10 +160,6 @@ vis.ftdetect.filetypes = { gherkin = { ext = { "%.feature$" }, }, - ['git-commit'] = { - ext = { "^COMMIT_EDITMSG$" }, - cmd = { "set colorcolumn 72" }, - }, ['git-rebase'] = { ext = { "git%-rebase%-todo" }, }, -- cgit v1.2.3