minus-squaremuntoo@lemmy.worldtoNeovim@sopuli.xyz•Mason Markdown FormattinglinkfedilinkEnglisharrow-up1·edit-21 year agoFor autoformatting, try an autocmd: autocmd BufWritePre * lua vim.lsp.buf.format() Or alternatively, I use: autocmd BufWritePre * lua require("utils").format() -- Formats the current buffer function utils.format() local whitelist = { "python", "rust" } if vim.tbl_contains(whitelist, vim.bo.filetype) then vim.lsp.buf.format() end end linkfedilink
minus-squaremuntoo@lemmy.worldtoLinux@lemmy.ml•Mission Center: A rust clone of the Windows Task Managerlinkfedilinkarrow-up4·1 year agoHave you tried Krita? linkfedilink
For autoformatting, try an autocmd:
Or alternatively, I use:
-- Formats the current buffer function utils.format() local whitelist = { "python", "rust" } if vim.tbl_contains(whitelist, vim.bo.filetype) then vim.lsp.buf.format() end end