From 25a2605405d8ec7645d0664914c3b7290745afec Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 15 Apr 2024 17:37:53 +0200 Subject: synced --- config/essentials/zsh/widgets.zsh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'config/essentials/zsh/widgets.zsh') diff --git a/config/essentials/zsh/widgets.zsh b/config/essentials/zsh/widgets.zsh index c8b24f7..233ea65 100644 --- a/config/essentials/zsh/widgets.zsh +++ b/config/essentials/zsh/widgets.zsh @@ -1,4 +1,4 @@ -# surround line in variable +# Surround line in variable surround_in_var() { BUFFER=" \"\$($BUFFER)\"" @@ -7,3 +7,12 @@ surround_in_var() zle -N surround_in_var bindkey '\ev' surround_in_var +# Insert output from the previous command +zmodload -i zsh/parameter +insert-last-command-output() { + LBUFFER+="$(eval $history[$((HISTCMD-1))])" +} +zle -N insert-last-command-output +bindkey "^Xl" insert-last-command-output + +# -- cgit v1.2.3