From 58ee0ade7f4c436fb6c84cc257b1abb9edbffc36 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 8 Aug 2022 23:29:17 +0200 Subject: [PATCH] nvim: add colorcolumn-workaround for git commits --- .config/nvim/lua/coding.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/coding.lua b/.config/nvim/lua/coding.lua index e3f5f59..e3b07d8 100644 --- a/.config/nvim/lua/coding.lua +++ b/.config/nvim/lua/coding.lua @@ -20,5 +20,9 @@ packer.use { vim.api.nvim_create_autocmd('FileType', { pattern = { 'gitcommit', 'gitrebase' }, - command = 'startinsert | 1', + callback = function() + -- FIXME: why does the autocmd in settings.lua not set it? + vim.wo.colorcolumn = tostring(vim.o.textwidth) + vim.cmd([[startinsert | 1]]) + end })