From 88a4c6ae6ecc38d88ef0b836d6d351e45492b455 Mon Sep 17 00:00:00 2001 From: Luan Date: Mon, 25 Jul 2022 01:21:47 +0200 Subject: [PATCH] Change for format options to disable auto comment vim.cmd [[set formatoptions-=cro]] -- TODO: this doesn't seem to work Found that using the formatoptions in form of a table, and setting the options to false fixes the setting for -cro. --- lua/user/options.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/user/options.lua b/lua/user/options.lua index 799aa9d..6744721 100644 --- a/lua/user/options.lua +++ b/lua/user/options.lua @@ -33,6 +33,11 @@ local options = { scrolloff = 8, -- is one of my fav sidescrolloff = 8, guifont = "monospace:h17", -- the font used in graphical neovim applications + formatoptions = { + c = false, -- Automatically insert the current comment leader after hitting 'o' or 'O' in Normal mode. + r = false, -- Automatically insert the current comment leader after hitting in Insert mode. + o = false, -- Auto-wrap comments using textwidth, inserting the current comment leader automatically. + }, } vim.opt.shortmess:append "c" @@ -43,4 +48,4 @@ end vim.cmd "set whichwrap+=<,>,[,],h,l" vim.cmd [[set iskeyword+=-]] -vim.cmd [[set formatoptions-=cro]] -- TODO: this doesn't seem to work +