write proper prose mode function (WIP)
This commit is contained in:
parent
af1536b5c7
commit
24fafba36c
|
@ -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,
|
||||
})
|
Loading…
Reference in New Issue