25 lines
821 B
Lua
25 lines
821 B
Lua
local markdown_format = vim.api.nvim_create_augroup("markdown_format", { clear = true })
|
|
|
|
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
|
|
group = markdown_format,
|
|
pattern = { "*.md" },
|
|
callback = function()
|
|
vim.opt_local.spell = true
|
|
vim.opt_local.wrap = true
|
|
vim.opt_local.linebreak = true
|
|
vim.opt_local.colorcolumn = "0"
|
|
vim.opt_local.conceallevel = 2
|
|
end
|
|
})
|
|
|
|
-- vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter", "VimResized", "WinResized"}, {
|
|
-- group = markdown_format,
|
|
-- callback = function()
|
|
-- if vim.bo.filetype == 'markdown' then
|
|
-- local width = vim.api.nvim_win_get_width(0)
|
|
-- if width > 120 then
|
|
-- vim.opt_local.columns = 120
|
|
-- end
|
|
-- end
|
|
-- end
|
|
-- })
|