From 849f4068de9831fdaa635c2372dada9131fb5a39 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 5 Mar 2002 16:33:19 +0000 Subject: 16767: Src/Zle/zle_hist.c, Doc/Zsh/zle.yo, Doc/Zsh/contrib.yo, Functions/Zle/copy-earlier-word: Enhance insert-last-word to pick different lines from the history (including the current line) and different words from that line. Add copy-earlier-word as suggested by Dominik Vogt to copy words from either the current line, or (following an insert-last-word) a previous history line. --- Doc/Zsh/contrib.yo | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Doc/Zsh/contrib.yo') diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 654fa699c..21997b7d8 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -524,6 +524,20 @@ example(zle -N insert-last-assignment smart-insert-last-word zstyle :insert-last-assignment match '[[:alpha:]][][[:alnum:]]#=*' bindkey '\e=' insert-last-assignment) ) +findex(copy-earlier-word) +item(tt(copy-earlier-word))( +This widget works like a combination of tt(insert-last-word) and +tt(copy-prev-shell-word). Repeated invocations of the widget retrieve +earlier words on the relevant history line. With a numeric argument +var(N), insert the var(N)th word from the history line; var(N) may be +negative to count from the end of the line. + +If tt(insert-last-word) has been used to retrieve the last word on a +previous history line, repeated invocations will replace that word with +earlier words from the same line. + +Otherwise, the widget applies to words on the line currently being edited. +) enditem() subsect(Styles) -- cgit 1.4.1