From 9c42846395b5982b40edb57d1bf754563baba5e9 Mon Sep 17 00:00:00 2001 From: Huck Boles Date: Tue, 30 May 2023 16:40:57 -0500 Subject: [PATCH] added: autofunc for textwidth on text files --- lua/huck/functions.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/huck/functions.lua b/lua/huck/functions.lua index bb58736..37f3e84 100644 --- a/lua/huck/functions.lua +++ b/lua/huck/functions.lua @@ -17,6 +17,14 @@ vim.api.nvim_create_autocmd("BufWinEnter", { end, }) +-- set text width +vim.api.nvim_create_autocmd("BufWinEnter", { + pattern = { "*.md", "*.txt" }, + callback = function() + vim.o.textwidth = 80 + end, +}) + -- check template folder and if a template.[filetype] exists use it vim.api.nvim_create_autocmd("BufNewFile", { pattern = { "*" }, -- 2.45.2