From 2f85bbe61513d12c746641fed6ad07559bd95719 Mon Sep 17 00:00:00 2001 From: altermo <107814000+altermo@users.noreply.github.com> Date: Mon, 26 Feb 2024 11:42:51 -0800 Subject: feat!: rewrite TOhtml in lua Co-authored-by: wookayin Co-authored-by: clason Co-authored-by: Lewis Russell --- runtime/plugin/tohtml.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 runtime/plugin/tohtml.lua (limited to 'runtime/plugin/tohtml.lua') diff --git a/runtime/plugin/tohtml.lua b/runtime/plugin/tohtml.lua new file mode 100644 index 0000000000..893419ece6 --- /dev/null +++ b/runtime/plugin/tohtml.lua @@ -0,0 +1,11 @@ +if vim.g.loaded_2html_plugin ~= nil then + return +end +vim.g.loaded_2html_plugin = true + +vim.api.nvim_create_user_command('TOhtml', function(args) + local outfile = args.args ~= '' and args.args or vim.fn.tempname() .. '.html' + local html = require('tohtml').tohtml() + vim.fn.writefile(html, outfile) + vim.cmd.split(outfile) +end, { bar = true, nargs = '?' }) -- cgit