Ctrl-q is the most useful zsh keybinding that I can never for the life of me remember when I need it. It saves the currently typed command, lets you run one command, and then restores the previously saved command (for Bash it's Ctrl-u to save the command, then Ctrl-y to restore it when you're ready). So for example if you forget a filename in a command without autocomplete, you can Ctrl-q, run ls
, and then you're right back in the partially typed command.
@nytpu Ah, it's there in the emacs mode, and i have zsh in vi mode, so i will have to bind it explicitly, thank you.
@L29Ah
It's in the Zsh manual as a default binding and I have a completely stock Zsh with no plugins and a minimal configuration, so clearly you're the one who's changed something or are running a really old version (or you're in Vim mode where it's esc-q instead of ctrl-q)
https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Miscellaneous
For Bash I I misremembered, it's Ctrl-u to kill the line, then Ctrl-y to paste it back after you're done running other commands