Fix edit-command-line-split

This commit is contained in:
crater2150 2023-08-21 11:53:57 +02:00
parent 85ec31479e
commit b5deb6e21f
3 changed files with 21 additions and 19 deletions

View file

@ -32,6 +32,8 @@ bindkey " " magic-space # Do history expansion on space.
bindkey $'\177' backward-delete-char # backspace bindkey $'\177' backward-delete-char # backspace
bindkey $'\10' backward-delete-word # C-backspace bindkey $'\10' backward-delete-word # C-backspace
autoload -U edit-command-line-split
zle -N edit-command-line-split
bindkey -M vicmd ! edit-command-line-split bindkey -M vicmd ! edit-command-line-split
#unicode input #unicode input
@ -55,7 +57,7 @@ local function zle-line-finish () {
echoti rmkx 2> /dev/null echoti rmkx 2> /dev/null
} }
zle -N zle-line-init zle -N zle-line-init
zle -N zle-line-finish zle -N zle-line-finish
insert_sudo () { LBUFFER="sudo ${LBUFFER}" } insert_sudo () { LBUFFER="sudo ${LBUFFER}" }
zle -N insert-sudo insert_sudo zle -N insert-sudo insert_sudo

View file

@ -1,5 +1,5 @@
# autoload completions # autoload completions
fpath=( "${ZDOTDIR:+$ZDOTDIR/compdef}" "/etc/zsh/compdef" $fpath ) fpath=( "${XDG_DATA_HOME:-$HOME/.local/share}/zsh/site-functions" "${ZDOTDIR:+$ZDOTDIR/compdef}" "/etc/zsh/compdef" $fpath )
fpath=("$XDG_DATA_HOME/scalacli/completions/zsh" $fpath) fpath=("$XDG_DATA_HOME/scalacli/completions/zsh" $fpath)
[[ -n $(echo /etc/zsh/compdef/*(N:t)) ]] && autoload -U /etc/zsh/compdef/*(N:t) [[ -n $(echo /etc/zsh/compdef/*(N:t)) ]] && autoload -U /etc/zsh/compdef/*(N:t)
@ -21,13 +21,13 @@ autoload -U +X bashcompinit && bashcompinit
zstyle ':completion:*:descriptions' format %B%d%b zstyle ':completion:*:descriptions' format %B%d%b
zstyle ':completion:*:messages' format %d zstyle ':completion:*:messages' format %d
zstyle ':completion:*:warnings' format No matches for: %d zstyle ':completion:*:warnings' format No matches for: %d
zstyle ':completion:*' use-cache on zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.cache/zsh zstyle ':completion:*' cache-path ~/.cache/zsh
zstyle ':completion:*' completer _complete _ignored _match _approximate _correct zstyle ':completion:*' completer _complete _ignored _match _approximate _correct
zstyle ':completion:*:match:*' original only zstyle ':completion:*:match:*' original only
zstyle ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3))numeric)' zstyle ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3))numeric)'
zstyle ':completion:*:functions' ignored-patterns '_*' zstyle ':completion:*:functions' ignored-patterns '_*'
zstyle ':completion:*' squeeze-slashes true zstyle ':completion:*' squeeze-slashes true
zstyle ':completion:*' expand prefix suffix zstyle ':completion:*' expand prefix suffix
zstyle ':completion:*' group-name '' zstyle ':completion:*' group-name ''
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}

View file

@ -1,16 +1,16 @@
edit-command-line-tmux() { local tmpfile=${TMPPREFIX:-/tmp/zsh}ecl$$
local tmpfile=${TMPPREFIX:-/tmp/zsh}ecl$$
print -R - "$PREBUFFER$BUFFER" >$tmpfile print -R - "$PREBUFFER$BUFFER" >$tmpfile
exec </dev/tty exec </dev/tty
if [[ $KITTY_WINDOW_ID ]]; then if [[ $KITTY_WINDOW_ID ]]; then
kitty @launch --type overlay vim -c 'set laststatus=0 showtabline=0 ft=zsh' $tmpfile kitty @launch --type overlay vim -c 'set laststatus=0 showtabline=0 ft=zsh' $tmpfile
tail -f --pid=$(pgrep -f "vim.*${tmpfile:t}") /dev/null tail -f --pid=$(pgrep -f "vim.*${tmpfile}") /dev/null &> /dev/null
else else
${=${VISUAL:-${EDITOR:-vi}}} $tmpfile ${=${VISUAL:-${EDITOR:-vi}}} $tmpfile
fi fi
print -Rz - "$(<$tmpfile)" print -Rz - "$(<$tmpfile)"
command rm -f $tmpfile command rm -f $tmpfile
zle send-break # Force reload from the buffer stack zle send-break # Force reload from the buffer stack
}
# vim:ft=zsh