Files
neovim/runtime/plugin/tohtml.lua
altermo 2f85bbe615 feat!: rewrite TOhtml in lua
Co-authored-by: wookayin <wookayin@gmail.com>
Co-authored-by: clason <c.clason@uni-graz.at>
Co-authored-by: Lewis Russell <me@lewisr.dev>
2024-02-28 16:26:00 +00:00

12 lines
361 B
Lua

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 = '?' })