zsh:keys:cmd-on-enter: Use ll instead of ls
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user