Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Edit result of last command



On Mon, 29 Nov 2004, zzapper wrote:

> say I've done a command a find/ls whatever
[...]
> This does the trick, but how would you zedii do it?

Don't you remember the "Tip of the day: previous command output" thread 
from back in August?

  keep *add*
  vi $kept

or

  find . -name '*add*' -print | keep
  vi $kept

or any one of several completion-based variants also in that thread.

I also have this pair of keybindings:

  bindkey "^[f" forward-word
  bindkey -s "^[v" '^E)^Avi $(^[f"

which means I scroll back in the history to the command I want to capture

  ls *add*

then type esc-v and end up with

  vi $(ls *add*)
         ^
with the cursor here, so I can modify the options (add -l to grep, or 
remove -l from ls, etc.).



Messages sorted by: Reverse Date, Date, Thread, Author