From 4bb936319c6229f9af3d7b30150e185d20d2f33d Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Sat, 22 Mar 2025 21:15:07 -0400 Subject: [PATCH] AutoYADM commit: 2025-03-22 21:15:07 --- .config/helix/config.toml | 3 +++ .config/pet/snippet.toml | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.config/helix/config.toml b/.config/helix/config.toml index c636c441..069df488 100644 --- a/.config/helix/config.toml +++ b/.config/helix/config.toml @@ -76,6 +76,9 @@ A-r = ":config-reload" A-o = ":config-open" A-w = ":config-open-workspace" +# execute current file +A-x = ":sh %{buffer_name}" + # Treesitter selections # Left <-> Right: Sibling nodes # Up <-> Down: Parent/Child nodes diff --git a/.config/pet/snippet.toml b/.config/pet/snippet.toml index f511cadc..74425848 100644 --- a/.config/pet/snippet.toml +++ b/.config/pet/snippet.toml @@ -1,13 +1,13 @@ [[Snippets]] - Description = "print the classic message" + Description = "mkpy: Edit Python scratch file" Output = "" - Tag = [] - command = "echo Hello world!" + Tag = ["python", "scratch"] + command = "TEMP=$(mktemp)\nmv \"$TEMP\" \"$TEMP.py\"\nprintf '#!/bin/env python\\n\\n' > \"$TEMP.py\"\nchmod +x \"$TEMP.py\"\nhx \"$TEMP.py\"" [[Snippets]] - Description = "Edit Python scratch file" + Description = "clearpy: Clear Python scratch files." Output = "" - Tag = [] - command = "TEMP=$(mktemp)\nmv \"$TEMP\" \"$TEMP.py\"\necho '#!/bin/env python' > \"$TEMP.py\"\nchmod +x \"$TEMP.py\"\nhx \"$TEMP.py\"" + Tag = ["python", "scratch"] + command = "rm -f /tmp/tmp.*.py"