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"