-- map the key (sequence) to a command local function map(mode, lhs, rhs, opts) local options = { noremap = true } if opts then options = vim.tbl_extend("force", options, opts) end vim.api.nvim_set_keymap(mode, lhs, rhs, options) end map("i", "", ":w:!just") map("n", "", ":w:!just") vim.cmd("inoremap : silent exec '.!inkscape-figures create \"'.getline('.').'\" \"'.b:vimtex.root.'/figures/\"':w") vim.cmd("nnoremap : silent exec '!inkscape-figures edit \"'.b:vimtex.root.'/figures/\" > /dev/null 2>&1 &':redraw!")