4 ms·
Yes please -- this sounds great, I used to use `ctrl-u` then `ctrl-y` with bash, and that doesn't work with zsh, alas. I tried searching for `zsh "park" comman
by chris_st 6y ago
Yes please -- this sounds great, I used to use `ctrl-u` then `ctrl-y` with bash, and that doesn't work with zsh, alas. I tried searching for `zsh "park" command` and got nothing useful.
- mjg123 6y agoIt's a feature of the zsh line editor called "push-line". http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
- chris_st 6y agoThanks very much! Adding: bindkey '^q' push-line works perfectly. Day improved!
- JNRowe 6y agoYou can also operate on the stack of pending commands programatically using the read and print builtins along with the common to both -z option. It can be a really nice way to build up or edit complex commands/variables in combination with expansion flags and such. 'print -z goodbye; print -z hello' for the five second example of what happens.
- weinzierl 6y agoThank you, I love it. This is so great for a quick ls or cd in between. Turns out it wasn't the terminal that was eating my Ctrl-q, but the key wasn't bound in my zsh. The page you linked says push-line (^Q ESC-Q ESC-q) (unbound)(unbound) Does that mean that in a standard config push-line is bound to Ctrl-q?
- JNRowe 6y agoFrom the man page: > The following is a list of all the standard widgets, and their default bindings in emacs mode, vi command mode and vi insert mode (the `emacs', `vicmd' and `viins' keymaps, respectively). What that means is that if you issue 'bindkey -e' from a bare .zshrc it will enable the emacs bindings and C-q will work. The other two unbound entries state that it isn't enabled by default if you want to use vi-style editing. The KEYMAPS section in the man page has a full explanation. The easy way to play with it is to start an extra zsh with "zsh -f" so it ignores your configs, call "bindkey" to see what the default bindings are like, then "bindkey -e; bindkey" to see all the goodies that are enabled in emacs mode for example.