From 41de5f27da62cbad1b79bab978b45eb814a70681 Mon Sep 17 00:00:00 2001 From: Sebastian Bugge Date: Sat, 27 Jan 2024 16:41:48 +0100 Subject: [PATCH] Add text wrap for markdown/text. --- lua/plugins/text.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lua/plugins/text.lua diff --git a/lua/plugins/text.lua b/lua/plugins/text.lua new file mode 100644 index 0000000..a59b690 --- /dev/null +++ b/lua/plugins/text.lua @@ -0,0 +1,15 @@ +vim.api.nvim_create_autocmd({ "FileType" }, { + pattern = { "text", "markdown" }, + callback = function() + vim.opt.textwidth = 80 + vim.opt.wrapmargin = 0 + vim.opt.formatoptions:append("t") + vim.opt.linebreak = true + vim.opt.tabstop = 2 + vim.opt.softtabstop = 2 + vim.opt.shiftwidth = 2 + vim.opt.expandtab = false + end, +}) + +return {}