vern@2008-01-18:/var% ls tags

zsh 独门秘笈 4

Alt-Q (Alt-q) Push the current buffer onto the buffer stack and clear the buffer. Next time the editor starts up, the buffer will be popped off the top of the buffer stack and loaded into the editing buffer.

Alt-G (Alt-g) Pop the top line off the buffer stack and insert it at the cursor position.

例如在拷贝之前,意识到目标目录 foo 尚未创建, 1$ cp somefile /tmp/foo/ [光标] 我可以用 Alt-Q 缓存当前已输入的命令行,然后 2$ mkdir /tmp/foo 此命令执行之后,刚才保存的拷贝命令行自动出现 3$ cp somefile /tmp/foo/ [光标]

Ctrl-X Ctrl-V Enter command mode; that is, use the alternate keymap. Yes, this is bound by default in vi mode.