mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 06:12:34 +00:00
Added automatic text-width for markdown
This commit is contained in:
@@ -15,12 +15,22 @@ vim.api.nvim_exec([[
|
|||||||
]], false)
|
]], false)
|
||||||
|
|
||||||
-- Wrap markdown lines when a buffer is written.
|
-- Wrap markdown lines when a buffer is written.
|
||||||
|
local markdownGroup = vim.api.nvim_create_augroup("MyMarkdownGroup", { clear = true })
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd(
|
||||||
|
"BufEnter",
|
||||||
|
{
|
||||||
|
pattern = { "*.md", "*.markdown" },
|
||||||
|
command = "setlocal textwidth=80",
|
||||||
|
group = markdownGroup
|
||||||
|
}
|
||||||
|
)
|
||||||
vim.api.nvim_create_autocmd(
|
vim.api.nvim_create_autocmd(
|
||||||
"BufWritePre",
|
"BufWritePre",
|
||||||
{
|
{
|
||||||
pattern = { "*.md", "*.markdown" },
|
pattern = { "*.md", "*.markdown" },
|
||||||
command = ":normal ggVGgq",
|
command = ":normal ggVGgq",
|
||||||
group = vim.api.nvim_create_augroup("MyMarkdownLineWrapper", { clear = true })
|
group = markdownGroup
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user