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", +})