Last active
December 16, 2015 15:29
-
-
Save lann/5456017 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
g = !env GIT_PAGER='gawk -f ~/file-alias-pager.awk | less' git grep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function precmd { | |
# you might have this already: vcs_info 'prompt' | |
source ~/.zsh-file-aliases | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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