On Bash I was using ESC # after Ctrl+R to prefix a # to the found line and keep it in the terminal, something similar for zsh?
1 Answer
See man zshzle for the pound-insert and vi-pound-insert widgets. The first will toggle a pound sign at the beginning of the buffer, the second at the beginning of the current line. Only pound-insert is bound by default, and then only in the vicmd key map, to #. To bind pound-insert, add this line to your .zshrc:
bindkey '\e#' pound-insert - 1Thank you that was easy once pointed in the right direction
bindkey '^[#' pound-insert:-)Alex– Alex2014-10-28 22:05:09 +00:00Commented Oct 28, 2014 at 22:05
push-lineandpush-line-or-edit. This pushes the current command to the stack and clears the buffer. The next time the line editor starts up (e.g. the next prompt) the command is popped off the stack and put into the buffer. This is quite useful to put a longer command on hold if you need to do something before you can actually run it.