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

Re: PATCH: (maybe) negative ranges



On Wed, Sep 30, 2015 at 6:51 PM, Peter Stephenson
<p.stephenson@xxxxxxxxxxx> wrote:
> I'd like to be able to ignore ^ at the start of a git range
> specification to support things like
>
>   git log r1 ^r2

Can't say anything helpful about the completion, but you may find this helpful,

function _self_insert_git() {
  if [[ $BUFFER = (git(-| )|gitk |qgit )* ]]; then
    if [[ ! $LBUFFER[-1] = '\' && $LBUFFER != *\ --\ * ]]; then
      LBUFFER+='\'
    fi
  fi
  zle self-insert
}

zle -N self-insert-git _self_insert_git
bindkey '^' self-insert-git
bindkey -M isearch '^' self-insert

-- 
Mikael Magnusson



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