zsh函数将任意字符串放入行编辑器

zsh函数将任意字符串放入行编辑器,zsh,Zsh,我想创建一个zsh函数,将计算出的字符串放入行编辑器中,例如 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 插入_foo(){ #执行将字符串“foo”放入行编辑器的操作 } $insert_

我想创建一个zsh函数,将计算出的字符串放入行编辑器中,例如

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
插入_foo(){
#执行将字符串“foo”放入行编辑器的操作
}
$insert_foo
$foo#我们可以使用:

以下是zsh文件的副本:

打印
[-abcdilmnnooprssz]
[-u n]
[-f格式]
[-C列]


-z
将参数推送到编辑缓冲堆栈上,以空格分隔

---

我们可以使用:

以下是zsh文件的副本:

打印
[-abcdilmnnooprssz]
[-u n]
[-f格式]
[-C列]


-z
将参数推送到编辑缓冲堆栈上,以空格分隔

---

insert_foo() {
  print -z "foo"
}