Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: backward-kill-shell-word widget



On Jan 1, 12:37am, Daniel Shahaf wrote:
}
} This widget is like ^W but for "shell words" rather than
} whitespace-separated words, so
} 
}     % echo foo "bar baz" <CURSOR>^W
}     becomes
}     % echo foo <CURSOR>

As of 5.0.8 you can do this with:

    backward-kill-shell-word() {
      zle select-in-shell-word
      ((++CURSOR))  # adjust for vi vs. emacs region
      zle kill-region
    }

I'm not sure if that CURSOR adjustment is a a bug or just a necessary
evil because of using vi binding in the emacs keymap.



Messages sorted by: Reverse Date, Date, Thread, Author