From c45cbb63a606075fa8cb08d149c36ea3a762e622 Mon Sep 17 00:00:00 2001 From: Daniel Carrillo Date: Fri, 11 Nov 2022 18:32:43 +0100 Subject: [PATCH] [neovim] remove unnecessary autocommand and replace it with an option --- .config/nvim/lua/core/autocommands.lua | 7 ------- .config/nvim/lua/core/options.lua | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.config/nvim/lua/core/autocommands.lua b/.config/nvim/lua/core/autocommands.lua index 5da7b77..1a4658a 100644 --- a/.config/nvim/lua/core/autocommands.lua +++ b/.config/nvim/lua/core/autocommands.lua @@ -1,12 +1,5 @@ vim.cmd("autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif") --- Fixes Autocomment -vim.api.nvim_create_autocmd({ "BufWinEnter" }, { - callback = function() - vim.cmd("set formatoptions-=cro") - end, -}) - -- Highlight Yanked Text vim.api.nvim_create_autocmd({ "TextYankPost" }, { callback = function() diff --git a/.config/nvim/lua/core/options.lua b/.config/nvim/lua/core/options.lua index 4c65784..b1c78ff 100644 --- a/.config/nvim/lua/core/options.lua +++ b/.config/nvim/lua/core/options.lua @@ -40,6 +40,7 @@ vim.opt.fillchars.eob = " " vim.opt.shortmess:append("c") vim.opt.whichwrap:append("<,>,[,],h,l") vim.opt.iskeyword:append("-") +vim.opt.formatoptions:remove({ "c", "r", "o" }) -- experimental vim.opt.cmdheight = 0 -- Number of screen lines to use for the command-line