Execute ls when enter is pressed with empty buffer

This commit is contained in:
2020-07-31 16:38:38 +02:00
parent a9955af675
commit 158a1c757d

View File

@@ -74,3 +74,17 @@ function _expandDots {
zle -N _expandDots
bindkey . _expandDots
function ls-on-enter {
if [ -z "$BUFFER" ]; then
echo "ls"
ls
echo "\n"
zle redisplay
else
zle accept-line
fi
}
zle -N ls-on-enter
bindkey "^M" ls-on-enter
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(ls-on-enter)