From 3c4c30969c0b60eb6de050adb7a6197261432290 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sun, 10 Mar 2024 18:26:36 -0500 Subject: [PATCH] feat(nvim): add run key for 'python' files --- dots/.config/nvim/after/ftplugin/python.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dots/.config/nvim/after/ftplugin/python.lua b/dots/.config/nvim/after/ftplugin/python.lua index c0205e4d..f99ff8f7 100644 --- a/dots/.config/nvim/after/ftplugin/python.lua +++ b/dots/.config/nvim/after/ftplugin/python.lua @@ -39,3 +39,11 @@ vim.api.nvim_create_autocmd("InsertCharPre", { vim.api.nvim_input("m'" .. row + 1 .. "gg" .. col + 1 .. "|if`'la") end, }) + +vim.keymap.set("n", "fr", function() + vim.cmd.write() + require("toggleterm").exec("python " .. vim.api.nvim_buf_get_name(0)) +end, { + buffer = true, + desc = "Python: Save and Run Current Buffer", +})