useful zsh trick
Today I learned about "ctrl+q". This command is known as "parking" and what it does is takes the command you are typing, stashes it elsewhere and clears your command line, then after you execute your next command, retrieves it and fills your prompt.
So for example if I'm typing a git command and realized I need to `git diff` first, I can ctrl+q to "park" the command, type the diff, and then immediately get back to my original parked command
useful zsh trick
@darius Somehow it doesn't work for me
useful zsh trick
@x44203 Are you in vi mode? It's not defined there.
useful zsh trick
@aza_leah vi mode?
useful zsh trick
@darius okay, this _will_ be useful! Many thanks for sharing :>
useful zsh trick
@darius Ha, a git stash for your shell. That's great!
useful zsh trick
@darius even better, the stash is a *stack*, you can push a bunch of commands onto it and they'll get popped back out one at a time. There's also a "swap top two items on the cmd stack" key that I can never remember.
useful zsh trick
@darius WH ATT
useful zsh trick
@darius whoa, no way. i do this constantly with something like ctrl-a (go to start of line), ctrl-k (kill line), enter other command, ctrl-y (insert kill buffer). going to save me a lot of keystrokes if i manage to remember this one.
note for other readers: i think my terminal eats ctrl-q, but esc q works just fine.