zsh:keys:cmd-on-enter: Use ll instead of ls

This commit is contained in:
2021-12-29 17:28:41 +01:00
parent 0015f2a223
commit 9f99ceafd4

View File

@@ -101,19 +101,19 @@ bindkey . rationalize_dots
function cmd-on-enter {
zle -M "$CMD_ON_ENTER"
if [[ -z $BUFFER ]]; then
# Overwrite BUFFER and default to ls
BUFFER="${CMD_ON_ENTER:=ls}"
# Overwrite BUFFER and default to ll
BUFFER="${CMD_ON_ENTER:=ll}"
# Cycle through ls and git status
# Cycle through ll and git status
case "$CMD_ON_ENTER" in
ls)
ll)
! git rev-parse &>/dev/null || CMD_ON_ENTER='gs';;
gs)
CMD_ON_ENTER='ls';;
CMD_ON_ENTER='ll';;
esac
else
# Reset if other command is executed
CMD_ON_ENTER=ls
CMD_ON_ENTER=ll
fi
zle accept-line
}