From c6084225fdaffb0093a9a5d64ff290f7fba3baf9 Mon Sep 17 00:00:00 2001 From: rootiest Date: Wed, 5 Mar 2025 15:24:38 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Feat(keymap):=20don't=20comment=20n?= =?UTF-8?q?ewline=20when=20using=20`o`=20key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Normal insert-mode newlines continue comments. Pressing `o` in normal-mode will create a newline without commenting it. --- lua/config/autocmds.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index 529b190..7012d8d 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -133,7 +133,6 @@ autocmd('CmdlineLeave', { }) autogrp('RootyCustomEvent', { clear = true }) - autocmd({ 'BufReadPost', 'BufNewFile' }, { group = 'RootyCustomEvent', callback = function(args) @@ -145,3 +144,11 @@ autocmd({ 'BufReadPost', 'BufNewFile' }, { end end, }) + +-- Don't comment next line when using `o` +vim.api.nvim_create_autocmd('FileType', { + pattern = '*', + callback = function() + vim.opt_local.formatoptions:remove({ 'o' }) + end, +})