[zsh] enhance g function