From 0b133fdd8d867f8affddf27d4227fed2eb2157a9 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 12 Sep 2023 21:20:04 +0200 Subject: nvim: Properly disable auto-commenting --- .config/nvim/lua/mango/set.lua | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to '.config/nvim/lua') diff --git a/.config/nvim/lua/mango/set.lua b/.config/nvim/lua/mango/set.lua index 28c5cf2..9428df5 100644 --- a/.config/nvim/lua/mango/set.lua +++ b/.config/nvim/lua/mango/set.lua @@ -1,4 +1,5 @@ local lib = require('mango.lib') +local api = vim.api local opt = vim.opt opt.nu = true @@ -29,8 +30,17 @@ opt.updatetime = 50 opt.colorcolumn = '81' --- Disable auto commenting -vim.bo.formatoptions = 'jnql' - opt.splitright = true opt.splitbelow = true + +-- Disable auto commenting +local group = api.nvim_create_augroup('Mango', { clear = true }) +api.nvim_create_autocmd( + 'BufEnter', + { + callback = function() + opt.formatoptions:remove({'c', 'r', 'o'}) + end, + group = group, + } +) -- cgit v1.2.3