From bb59168c52b0fa1b3ae87ca89ffda688d9eb3d4f Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Tue, 4 Oct 2022 21:51:32 +0200 Subject: [PATCH] vim: fix `tabular` configuration via packer --- config/nvim/lua/fs/plugins.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/nvim/lua/fs/plugins.lua b/config/nvim/lua/fs/plugins.lua index ad68635..5bd5134 100644 --- a/config/nvim/lua/fs/plugins.lua +++ b/config/nvim/lua/fs/plugins.lua @@ -136,6 +136,13 @@ return packer().startup(function(use) use { 'godlygeek/tabular', + setup = function() + -- This function is intentionally empty. If I don't have a setup() + -- function, somehow packer calls config() BEFORE the plugin is loaded + -- and therefore the command AddTabularPattern still doesn't exist and + -- config() throws errors on nvim startup. + end, + config = function() vim.cmd [[AddTabularPattern first_comma /^[^,]*\zs,/l0c1l0]] end,