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