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 {
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user