Add a vim keybinding to generate the currently

...open talk
This commit is contained in:
Oliver Davies 2024-08-09 21:56:05 +01:00
parent 5cab3659f4
commit d2530a138a
2 changed files with 17 additions and 0 deletions

9
keymaps.lua Normal file
View file

@ -0,0 +1,9 @@
-- Generate the PDF for the currently-open talk.
vim.keymap.set("n", "<leader>gp", function()
local talk_path = vim.fn.expand "%:p"
local talk_name = talk_path:match "src/([^/]+)/"
if talk_name ~= nil then
vim.cmd(string.format("!./run generate %s", talk_name))
end
end, { noremap = true, silent = true })