From f42322984ed9db587b8bd7e6689b790eba17d9bd Mon Sep 17 00:00:00 2001 From: c-salomonsen Date: Sat, 13 Sep 2025 02:09:53 +0200 Subject: [PATCH] Something old related to ltex and surround idek --- lua/options.lua | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/lua/options.lua b/lua/options.lua index 2bec6a5..b13bb9d 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -33,18 +33,6 @@ vim.api.nvim_create_autocmd("textyankpost", { -- Surround -vim.api.nvim_create_autocmd("QuickFixCmdPost", { - callback = function() - local qf = vim.fn.getqflist({ size = 0 }) - if qf.size > 0 then - vim.cmd("copen") - end - end, - pattern = "*", -}) - --- Surround - vim.api.nvim_create_autocmd("FileType", { pattern = "tex", callback = function() @@ -53,3 +41,16 @@ vim.api.nvim_create_autocmd("FileType", { vim.b.surround_102 = "\\textbf{" .. "\n" .. "}" end, }) + + +vim.api.nvim_create_autocmd("FileType", { + pattern = "tex", + callback = function() + -- Set a maximum line width of 88 characters + vim.bo.textwidth = 88 + -- Ensure 'formatoptions' includes the 't' flag for text wrapping + vim.bo.formatoptions = vim.bo.formatoptions .. "t" + -- Disable conform’s formatter so that gq uses Vim’s native formatter + vim.bo.formatexpr = "" + end, +})