-- options ==================================================================== vim.bo.textwidth = 80 vim.bo.iskeyword = vim.bo.iskeyword .. ",_,*" -- commands =================================================================== vim.api.nvim_create_user_command("OpenPdf", function(opts) local filepath = opts.nargs > 0 and opts.fargs[1] or vim.fn.bufname() filepath = vim.fs.abspath(filepath) if not filepath:match("%.typ$") then vim.notify(("Not a typst file: %s"):format(filepath), vim.log.levels.ERROR) return end vim.ui.open(filepath:gsub("%.typ$", ".pdf"), {}) end, { nargs = 1, })