From 50a31f900af0bef00b56fbf490ef97dc394d58af Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Fri, 4 Nov 2022 16:45:21 +0100 Subject: vim: install custom js/html/css-beautify null-ls formatters --- .vim/lua/plugins.lua | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to '.vim/lua') diff --git a/.vim/lua/plugins.lua b/.vim/lua/plugins.lua index 16c4c57..a16dc91 100644 --- a/.vim/lua/plugins.lua +++ b/.vim/lua/plugins.lua @@ -416,7 +416,6 @@ require('packer').startup({function() requires = {'nvim-lua/plenary.nvim'}, config = function() local nls = require('null-ls') - -- local h = require('null-ls.helpers') nls.setup { -- debug = true, sources = { @@ -431,6 +430,44 @@ require('packer').startup({function() }, on_attach = require('internal.lsp').my_attach, } + + local h = require('null-ls.helpers') + + nls.register({ + h.make_builtin({ + name = 'html-beautify', + filetypes = {'html', 'gotmpl.html'}, + method = nls.methods.FORMATTING, + generator_opts = { + command = vim.env.HOME .. '/.yarn/bin/html-beautify', + args = {'--file', '-', '--editorconfig'}, + to_stdin = true, + }, + factory = h.formatter_factory, + }), + h.make_builtin({ + name = 'html-beautify', + filetypes = {'html', 'gotmpl.html'}, + method = nls.methods.FORMATTING, + generator_opts = { + command = vim.env.HOME .. '/.yarn/bin/html-beautify', + args = {'--file', '-', '--editorconfig'}, + to_stdin = true, + }, + factory = h.formatter_factory, + }), + h.make_builtin({ + name = 'css-beautify', + filetypes = {'css', 'scss'}, + method = nls.methods.FORMATTING, + generator_opts = { + command = vim.env.HOME .. '/.yarn/bin/css-beautify', + args = {'--file', '-', '--editorconfig'}, + to_stdin = true, + }, + factory = h.formatter_factory, + }), + }) end} -- }}} use {'mfussenegger/nvim-dap', module = {'dap'}, -- {{{ -- cgit 1.4.1