Add a zsh binding for push-line-or-edit: ^Q
The use case for push-line-or-edit: 1. You are in the middle of typing a long command, perhaps something involving `tar`. 2. You realize that you must first run another command, such as `man tar`. 3. You invoke `push-line-or-edit`, which gives you a fresh prompt. You type `man tar` and read as needed. 4. When the command (`man tar`) finishes, the long command you half-typed is back, exactly as you left off. Other use cases are realizing that you're in the wrong directory before you press enter, changing your Ruby version before you press enter on that `bundle` command, or in general being partway through something and realizing that you're not quite ready to run it yet. While here, turn off start/stop output control, which gives us back the ^Q keybinding.
This commit is contained in:
parent
40ccf0f3f8
commit
a1a9f6d694
1 changed files with 4 additions and 0 deletions
|
@ -1,3 +1,6 @@
|
|||
# give us access to ^Q
|
||||
stty -ixon
|
||||
|
||||
# vi mode
|
||||
bindkey -v
|
||||
bindkey "^F" vi-cmd-mode
|
||||
|
@ -10,4 +13,5 @@ bindkey "^R" history-incremental-search-backward
|
|||
bindkey "^P" history-search-backward
|
||||
bindkey "^Y" accept-and-hold
|
||||
bindkey "^N" insert-last-word
|
||||
bindkey "^Q" push-line-or-edit
|
||||
bindkey -s "^T" "^[Isudo ^[A" # "t" for "toughguy"
|
||||
|
|
Loading…
Add table
Reference in a new issue