I'd like to create a zsh-function that will put a computed string into the line editor, e.g.
insert_foo() {
# Do something that will put the string "foo" in the line editor
}
$ insert_foo
$ foo # <- "foo" appears in the line editor, without actually executing it
I know this is possible within a zle-widget, but can it also be it's own command?