| Server IP : 74.208.236.79 / Your IP : 216.73.216.40 Web Server : Apache System : Linux infongp-us50 4.4.400-icpu-108 #2 SMP Wed Feb 11 10:12:42 UTC 2026 x86_64 User : u93192080 ( 6162215) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /kunden/usr/share/zsh/functions/Zle/ |
Upload File : |
# Replace an argument to a command, delimited by normal shell syntax.
# Prompts for the replacement.
# With no numeric argument, replace the current argument.
# With a numeric argument, replace that argument: 0 = command word,
# as in history expansion.
# If editing buffer is empty, use previous history line.
autoload -Uz split-shell-arguments read-from-minibuffer
if (( ${#BUFFER} == 0 )); then
(( HISTNO-- ))
CURSOR=${#BUFFER}
fi
local widget=$WIDGET numeric
integer cursor=CURSOR
if (( ${+NUMERIC} )); then
numeric=$NUMERIC
fi
local reply REPLY REPLY2
integer index
split-shell-arguments
if [[ -n $numeric ]]; then
if (( numeric < 0 )); then
(( index = ${#reply} - 1 + 2*(numeric+1) ))
else
(( index = 2 + 2*numeric ))
fi
else
(( index = REPLY & ~1 ))
fi
local edit
if [[ $widget = *edit* ]]; then
edit=$reply[$index]
fi
read-from-minibuffer "Replace $reply[$index] with: " $edit || return 1
integer diff=$(( ${#REPLY} - ${#reply[$index]} ))
reply[$index]=$REPLY
BUFFER=${(j..)reply}
if (( cursor > REPLY2 )); then
(( CURSOR = cursor + diff ))
else
(( CURSOR = REPLY2 ))
fi