From 3495a3edc7bd701f81a0e4e48927a0dc31a2b5df Mon Sep 17 00:00:00 2001 From: thek4n Date: Thu, 1 Feb 2024 16:19:07 +0300 Subject: [PATCH] nvim fix formatoptions lua --- home/user/.config/nvim/lua/base/options.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/home/user/.config/nvim/lua/base/options.lua b/home/user/.config/nvim/lua/base/options.lua index bb40db4..bc58c67 100644 --- a/home/user/.config/nvim/lua/base/options.lua +++ b/home/user/.config/nvim/lua/base/options.lua @@ -58,9 +58,15 @@ opt.colorcolumn = '81' opt.scrolloff = 7 -opt.formatoptions:remove("c") -opt.formatoptions:remove("r") -opt.formatoptions:remove("o") +-- disable paste comment on new line +vim.api.nvim_create_autocmd("BufEnter", { + pattern = {"*"}, + callback = function() + opt.formatoptions:remove("c") + opt.formatoptions:remove("r") + opt.formatoptions:remove("o") + end, +}) opt.termguicolors = true