Revisions
-
schmir created this gist
Jan 31, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ # When Tab is pressed on an empty(!) command line, the contents of the # directory are printed (`ls`) instead of a menu list of all # executables: function my-hg-report() { tip=$(hg tip 2> /dev/null) || return echo hg --config pager.pager= status echo hg --config pager.pager= log --limit 5 --style compact } function my-git-report() { ref=$(git symbolic-ref HEAD 2> /dev/null) || return echo "------------------------------------------------------------" git status echo "------------------------------------------------------------" git log --pretty=tformat:"%ae %ci%C(bold)%d%Creset%n%h: %s%n" -3 --color |cat echo } function complete-or-list() { if [[ $#BUFFER == 0 ]]; then echo ls -F my-git-report || my-hg-report zle reset-prompt else zle expand-or-complete fi } zle -N complete-or-list bindkey '^I' complete-or-list