mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 06:12:34 +00:00
Added formatting for markdown, to wrap lines when buffer is saved
This commit is contained in:
@@ -14,3 +14,13 @@ vim.api.nvim_exec([[
|
||||
augroup END
|
||||
]], false)
|
||||
|
||||
-- Wrap markdown lines when a buffer is written.
|
||||
vim.api.nvim_create_autocmd(
|
||||
"BufWritePre",
|
||||
{
|
||||
pattern = { "*.md", "*.markdown" },
|
||||
command = ":normal ggVGgq",
|
||||
group = vim.api.nvim_create_augroup("MyMarkdownLineWrapper", { clear = true })
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -5,7 +5,14 @@ return {
|
||||
require("formatter").setup({
|
||||
filetype = {
|
||||
markdown = {
|
||||
require("formatter.filetypes.markdown").prettier
|
||||
exe = "prettier",
|
||||
args = {
|
||||
"--stdin-filepath",
|
||||
util.escape_path(util.get_current_buffer_file_path()),
|
||||
"--line-width",
|
||||
"100"
|
||||
},
|
||||
try_node_modules = true,
|
||||
},
|
||||
["*"] = {
|
||||
-- formatter for any / all file types.
|
||||
|
||||
Reference in New Issue
Block a user