]> git.huck.website - nvim.git/commitdiff
added: autofunc for textwidth on text files
authorHuck Boles <huck@huck.website>
Tue, 30 May 2023 21:40:57 +0000 (16:40 -0500)
committerHuck Boles <huck@huck.website>
Tue, 30 May 2023 21:40:57 +0000 (16:40 -0500)
lua/huck/functions.lua

index bb58736a63fbe32b67b9b8370da52614da37e0bf..37f3e84b3770aaf34af8561e4314df0e2114f15f 100644 (file)
@@ -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 = { "*" },