https://git.jolheiser.com/dotnix.git
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
module scratch { # Make a throwaway buffer export def --env main [ --description(-d): string # Optional filename description for identifying extension?: string = "txt" # File extension (for highlighting) ]: nothing -> nothing { mut name = "tmp" if $description != null { $name = $description } let tmp = mktemp --tmpdir --suffix $".($extension)" $"($name).XXX" ^$env.EDITOR $tmp } } use scratch *