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

Re: minor annoyance with zsh and git flow



On May 25, 11:25am, Rick DeNatale wrote:
} 
} git flow adds a subcommand to git.

Of course the root of all this is that "subcommands" are not a concept
that unix-derived shells were ever designed to deal with.  This ...
 
} The git flow subcommand has lower level subcommands itself

... is just adding injury to insult.

(Sorry, my curmudgeon is showing.)

} ->git flow feature checkout make_it_niftier
} 
} and hit enter, zsh helpfully? asks
} 
} zsh: correct 'feature' to 'features'
} 
} I can't figure out how to stop zsh from doing this.

You can't unless you're willing to unsetopt correctall.  Zsh assumes
that anything after the command word that doesn't start with a hyphen
is an ordinary argument, and the most common kind of ordinary argument
is a file name, and there you are.

} Ideas

Well ... you can hack something ... like so:

    zle-line-init() {
      # Reset correctall in case finish unset it
      setopt no_localoptions correctall
    }
    zle-line-finish() {
      if [[ $BUFFER = (${~CORRECTALL_IGNORE})* ]]
      then setopt no_localoptions no_correctall
      fi
    }
    zle -N zle-line-init
    zle -N zle-line-finish

    CORRECTALL_IGNORE="git flow feature "

Here CORRECTALL_IGNORE is a pattern, so you can add alternatives with
"|" between, etc.



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