write proper prose mode function (WIP)

This commit is contained in:
andrzej 2024-05-05 23:35:16 +02:00
parent af1536b5c7
commit 24fafba36c
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
local function setProseModeVars(on)
vim.opt.wrap = on
vim.opt.linebreak = on
vim.opt.number = not on
vim.opt.signcolumn = on and "no" or "auto"
end
vim.api.nvim_create_autocmd({ "Bufenter" }, {
callback = function()
if vim.bo.buftype ~= "nofile" then
vim.cmd("PencilSoft")
setProseModeVars(true)
else
vim.cmd("PencilOff")
setProseModeVars(false)
end
end,
})