From db26041f62ff5c524d2adf0546887f621e3b3697 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Wed, 2 Oct 2024 18:51:45 -0700 Subject: [PATCH] CRO --- after/ftplugin/c.lua | 1 - after/ftplugin/cpp.lua | 1 - after/ftplugin/lua.lua | 1 - lua/config/autocmd.lua | 7 +++++++ 4 files changed, 7 insertions(+), 3 deletions(-) delete mode 100644 after/ftplugin/lua.lua diff --git a/after/ftplugin/c.lua b/after/ftplugin/c.lua index 317dc36..62ee882 100644 --- a/after/ftplugin/c.lua +++ b/after/ftplugin/c.lua @@ -1,2 +1 @@ -vim.opt.formatoptions:remove({'c', 'r', 'o'}) vim.diagnostic.enable(false) diff --git a/after/ftplugin/cpp.lua b/after/ftplugin/cpp.lua index 317dc36..62ee882 100644 --- a/after/ftplugin/cpp.lua +++ b/after/ftplugin/cpp.lua @@ -1,2 +1 @@ -vim.opt.formatoptions:remove({'c', 'r', 'o'}) vim.diagnostic.enable(false) diff --git a/after/ftplugin/lua.lua b/after/ftplugin/lua.lua deleted file mode 100644 index 254c4e1..0000000 --- a/after/ftplugin/lua.lua +++ /dev/null @@ -1 +0,0 @@ -vim.opt.formatoptions:remove({'c', 'r', 'o'}) diff --git a/lua/config/autocmd.lua b/lua/config/autocmd.lua index 89762f2..191f77a 100644 --- a/lua/config/autocmd.lua +++ b/lua/config/autocmd.lua @@ -22,3 +22,10 @@ vim.api.nvim_create_autocmd({'FocusGained', 'BufEnter', 'CursorHold'}, { pattern = '*', command = 'checktime' }) + +vim.api.nvim_create_autocmd({'BufEnter'}, { + pattern = '*', + callback = function() + vim.opt.formatoptions:remove({'c', 'r', 'o'}) + end +})