neovim/lua/autocmds.lua

21 lines
546 B
Lua

local function augroup(name)
return vim.api.nvim_create_augroup("wf_" .. name, { clear = true })
end
vim.api.nvim_create_autocmd({ "FileType" }, {
group = augroup("spellcheck"),
pattern = { "gitcommit", "markdown", "md", "mdx" },
callback = function()
vim.opt_local.spell = true
end,
})
vim.api.nvim_create_autocmd({ "FileType" }, {
group = augroup("prose"),
pattern = { "gitcommit", "markdown", "md", "mdx" },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.textwidth = 80
vim.opt_local.linebreak = true
end,
})