Commit 33c22d09 authored by Frank Terbeck's avatar Frank Terbeck

Rewrite backward-kill-to-slash using jump-to-delim

Works with numeric prefixes and does not stop at characters that are
inconveniently missing from WORDCHARS.
parent 12e4f64d
......@@ -2375,12 +2375,15 @@ zle -N replace-string-again
# Insert slashes in a "smart" way (well, not really all that smart...).
zrcautoload smart-slash && zle -N smart-slash
if zrcautoload jump-to-delim; then
function jump-to-prev-/ () { jump-to-delim / 0 }
zle -N jump-to-prev-/
fi
# backward clear from cursor to the next '/'
function backward-kill-to-slash() {
local WORDCHARS="${WORDCHARS:s,/,} \\\'"
[[ $BUFFER != */* ]] && return
[[ $LBUFFER == [^/]##/ ]] && return
zle backward-kill-word
(( MARK = CURSOR ))
zle jump-to-prev-/ && zle kill-region
}
zle -N backward-kill-to-slash
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment