From d2530a138ad58e1d6436e3fbc16c7110c9c881b4 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 9 Aug 2024 21:56:05 +0100 Subject: [PATCH] Add a vim keybinding to generate the currently ...open talk --- keymaps.lua | 9 +++++++++ stylua.toml | 8 ++++++++ 2 files changed, 17 insertions(+) create mode 100644 keymaps.lua create mode 100644 stylua.toml diff --git a/keymaps.lua b/keymaps.lua new file mode 100644 index 0000000..9033b69 --- /dev/null +++ b/keymaps.lua @@ -0,0 +1,9 @@ +-- Generate the PDF for the currently-open talk. +vim.keymap.set("n", "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 }) diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 0000000..2c7fb8a --- /dev/null +++ b/stylua.toml @@ -0,0 +1,8 @@ +indent_type = "Spaces" +indent_width = 2 +line_endings = "Unix" +no_call_parentheses = true +quote_style = "AutoPreferDouble" + +[sort_requires] +enabled = true