diff --git a/nvim/lua/olinpin/plugins/attempt.lua b/nvim/lua/olinpin/plugins/attempt.lua new file mode 100644 index 0000000..420ee0f --- /dev/null +++ b/nvim/lua/olinpin/plugins/attempt.lua @@ -0,0 +1,36 @@ +return { + "m-demare/attempt.nvim", + config = function() + local attempt = require("attempt") + + attempt.setup({ + initial_content = { + php = "ss", attempt.new_select, { desc = "Attempt: Open Attempt" }) + vim.keymap.set("n", "si", attempt.new_input_ext, { desc = "Attempt: New Attempt with Input" }) + vim.keymap.set("n", "sr", function() + local ext = vim.fn.expand("%:e") + local cmd = cmd_map[ext] or 'echo "unsupported"' + vim.cmd("split | terminal " .. cmd .. " %") + end, { desc = "Attempt: Run Attempt" }) + vim.keymap.set("n", "sd", attempt.delete_buf, { desc = "Attempt: Delete Attempt from Current Buffer" }) + vim.keymap.set("n", "sc", attempt.rename_buf, { desc = "Attempt: Rename Attempt from Current Buffer" }) + vim.keymap.set("n", "sf", ":Telescope attempt", { desc = "Attempt: List Attempts with Telescope" }) + end, +}