🪴 my neovim config:)
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ftplugin: configure typst options

robin 265ce291 c5595225

+17 -5
+17 -5
config/after/ftplugin/typst.lua
··· 1 - vim.api.nvim_create_user_command("OpenPdf", function() 2 - local filepath = vim.fn.bufname() 3 - if filepath:match("%.typ$") then 4 - vim.ui.open(vim.fn.shellescape(filepath:gsub("%.typ$", ".pdf")), {}) 1 + -- options ==================================================================== 2 + 3 + vim.bo.textwidth = 80 4 + vim.bo.iskeyword = vim.bo.iskeyword .. ",_,*" 5 + 6 + -- commands =================================================================== 7 + 8 + vim.api.nvim_create_user_command("OpenPdf", function(opts) 9 + local filepath = opts.nargs > 0 and opts.fargs[1] or vim.fn.bufname() 10 + filepath = vim.fs.abspath(filepath) 11 + if not filepath:match("%.typ$") then 12 + vim.notify(("Not a typst file: %s"):format(filepath), vim.log.levels.ERROR) 13 + return 5 14 end 6 - end, {}) 15 + vim.ui.open(filepath:gsub("%.typ$", ".pdf"), {}) 16 + end, { 17 + nargs = 1, 18 + })