Skip to content

Instantly share code, notes, and snippets.

@lann
Last active December 16, 2015 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lann/5456017 to your computer and use it in GitHub Desktop.
Save lann/5456017 to your computer and use it in GitHub Desktop.
[alias]
g = !env GIT_PAGER='gawk -f ~/file-alias-pager.awk | less' git grep
function precmd {
# you might have this already: vcs_info 'prompt'
source ~/.zsh-file-aliases
}
BEGIN {
file = ENVIRON["HOME"] "/.zsh-file-aliases"
printf "" > file
}
match($0, /^([^\x1b:]*)[\x1b:].*$/, m) {
print "alias -g _" ++n "=" m[1] >> file
printf "\x1b[33m[%2d]\x1b[0m", n
}
{ print }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment